mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
VideoBackends: Use VideoCommon shader generators for efb2tex copies.
This will generate one shader per copy format. For now, it is the same shader with the colmat hard coded. So it should already improve the GPU performance a bit, but a rewrite of the shader generator is suggested. Half of the patch is done by linkmauve1: VideoCommon: Reorganise the shader writes.
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
|
||||
#include "VideoCommon/TextureCacheBase.h"
|
||||
#include "VideoCommon/TextureConversionShader.h"
|
||||
#include "VideoCommon/TextureConverterShaderGen.h"
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
|
||||
class AbstractTexture;
|
||||
@ -67,7 +68,8 @@ private:
|
||||
bool scale_by_half) override;
|
||||
|
||||
void CopyEFBToCacheEntry(TCacheEntry* entry, bool is_depth_copy, const EFBRectangle& src_rect,
|
||||
bool scale_by_half, unsigned int cbuf_id, const float* colmat) override;
|
||||
bool scale_by_half, unsigned int cbuf_id, const float* colmat,
|
||||
EFBCopyFormat dst_format, bool is_intensity) override;
|
||||
|
||||
bool CompileShaders() override;
|
||||
void DeleteShaders() override;
|
||||
@ -78,17 +80,16 @@ private:
|
||||
void CreateTextureDecodingResources();
|
||||
void DestroyTextureDecodingResources();
|
||||
|
||||
SHADER m_colorCopyProgram;
|
||||
SHADER m_colorMatrixProgram;
|
||||
SHADER m_depthMatrixProgram;
|
||||
GLuint m_colorMatrixUniform;
|
||||
GLuint m_depthMatrixUniform;
|
||||
GLuint m_colorCopyPositionUniform;
|
||||
GLuint m_colorMatrixPositionUniform;
|
||||
GLuint m_depthCopyPositionUniform;
|
||||
struct EFBCopyShader
|
||||
{
|
||||
SHADER shader;
|
||||
GLuint position_uniform;
|
||||
};
|
||||
|
||||
u32 m_color_cbuf_id;
|
||||
u32 m_depth_cbuf_id;
|
||||
std::map<TextureConverterShaderUid, EFBCopyShader> m_efb_copy_programs;
|
||||
|
||||
SHADER m_colorCopyProgram;
|
||||
GLuint m_colorCopyPositionUniform;
|
||||
|
||||
std::array<PaletteShader, 3> m_palette_shaders;
|
||||
std::unique_ptr<StreamBuffer> m_palette_stream_buffer;
|
||||
|
Reference in New Issue
Block a user