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

@ -270,7 +270,7 @@ static void EncodeToRamUsingShader(GLuint srcTexture, u8* destAddr, u32 dst_line
}
void EncodeToRamFromTexture(u8* dest_ptr, u32 format, u32 native_width, u32 bytes_per_row,
u32 num_blocks_y, u32 memory_stride, PEControl::PixelFormat srcFormat,
u32 num_blocks_y, u32 memory_stride, bool is_depth_copy,
bool bIsIntensityFmt, int bScaleByHalf, const EFBRectangle& source)
{
g_renderer->ResetAPIState();
@ -281,12 +281,11 @@ void EncodeToRamFromTexture(u8* dest_ptr, u32 format, u32 native_width, u32 byte
glUniform4i(s_encodingUniforms[format], source.left, source.top, native_width,
bScaleByHalf ? 2 : 1);
const GLuint read_texture = (srcFormat == PEControl::Z24) ?
FramebufferManager::ResolveAndGetDepthTarget(source) :
FramebufferManager::ResolveAndGetRenderTarget(source);
const GLuint read_texture = is_depth_copy ? FramebufferManager::ResolveAndGetDepthTarget(source) :
FramebufferManager::ResolveAndGetRenderTarget(source);
EncodeToRamUsingShader(read_texture, dest_ptr, bytes_per_row, num_blocks_y, memory_stride,
bScaleByHalf > 0 && srcFormat != PEControl::Z24);
bScaleByHalf > 0 && !is_depth_copy);
FramebufferManager::SetFramebuffer(0);
g_renderer->RestoreAPIState();