TextureCache: Extract BP enum check to VideoCommon.

We have TOO many video backends.
This commit is contained in:
degasus
2016-12-26 20:54:37 +01:00
parent d07d9ba499
commit 04f319066d
23 changed files with 112 additions and 135 deletions

View File

@ -18,7 +18,7 @@ public:
void Init();
void Shutdown();
void Encode(u8* dst, u32 format, u32 native_width, u32 bytes_per_row, u32 num_blocks_y,
u32 memory_stride, PEControl::PixelFormat src_format, const EFBRectangle& src_rect,
u32 memory_stride, bool is_depth_copy, const EFBRectangle& src_rect,
bool is_intensity, bool scale_by_half);
private:
@ -32,14 +32,14 @@ private:
ID3D12Resource* m_encode_params_buffer = nullptr;
void* m_encode_params_buffer_data = nullptr;
D3D12_SHADER_BYTECODE SetStaticShader(unsigned int dst_format, PEControl::PixelFormat src_format,
D3D12_SHADER_BYTECODE SetStaticShader(unsigned int dst_format, bool is_depth_copy,
bool is_intensity, bool scale_by_half);
using ComboKey = unsigned int; // Key for a shader combination
static ComboKey MakeComboKey(unsigned int dst_format, PEControl::PixelFormat src_format,
bool is_intensity, bool scale_by_half)
static ComboKey MakeComboKey(unsigned int dst_format, bool is_depth_copy, bool is_intensity,
bool scale_by_half)
{
return (dst_format << 4) | (static_cast<int>(src_format) << 2) | (is_intensity ? (1 << 1) : 0) |
return (dst_format << 4) | (is_depth_copy << 2) | (is_intensity ? (1 << 1) : 0) |
(scale_by_half ? (1 << 0) : 0);
}