OGL: Remove TCache::Entry usage in TextureConverter

This commit is contained in:
degasus 2015-10-29 08:42:30 +01:00
parent 3df344ed38
commit 495902787c
3 changed files with 12 additions and 8 deletions

View File

@ -272,7 +272,11 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dstPointer, unsigned int ds
{
TextureConverter::EncodeToRamFromTexture(
dstPointer,
this,
format,
native_width,
BytesPerRow(),
NumBlocksY(),
memory_stride,
read_texture,
srcFormat == PEControl::Z24,
isIntensity,

View File

@ -269,18 +269,18 @@ static void EncodeToRamUsingShader(GLuint srcTexture,
}
}
void EncodeToRamFromTexture(u8 *dest_ptr, const TextureCache::TCacheEntryBase *texture_entry,
void EncodeToRamFromTexture(u8 *dest_ptr, u32 format, u32 native_width, u32 bytes_per_row, u32 num_blocks_y, u32 memory_stride,
GLuint source_texture, bool bFromZBuffer, bool bIsIntensityFmt, int bScaleByHalf, const EFBRectangle& source)
{
SHADER& texconv_shader = GetOrCreateEncodingShader(texture_entry->format);
SHADER& texconv_shader = GetOrCreateEncodingShader(format);
texconv_shader.Bind();
glUniform4i(s_encodingUniforms[texture_entry->format],
source.left, source.top, texture_entry->native_width, bScaleByHalf ? 2 : 1);
glUniform4i(s_encodingUniforms[format],
source.left, source.top, native_width, bScaleByHalf ? 2 : 1);
EncodeToRamUsingShader(source_texture,
dest_ptr, texture_entry->BytesPerRow(), texture_entry->NumBlocksY(),
texture_entry->memory_stride, bScaleByHalf > 0 && !bFromZBuffer);
dest_ptr, bytes_per_row, num_blocks_y,
memory_stride, bScaleByHalf > 0 && !bFromZBuffer);
}
void EncodeToRamYUYV(GLuint srcTexture, const TargetRectangle& sourceRc, u8* destAddr, u32 dstWidth, u32 dstStride, u32 dstHeight)

View File

@ -26,7 +26,7 @@ void EncodeToRamYUYV(GLuint srcTexture, const TargetRectangle& sourceRc,
void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTexture);
// returns size of the encoded data (in bytes)
void EncodeToRamFromTexture(u8* dest_ptr, const TextureCacheBase::TCacheEntryBase* texture_entry,
void EncodeToRamFromTexture(u8 *dest_ptr, u32 format, u32 native_width, u32 bytes_per_row, u32 num_blocks_y, u32 memory_stride,
GLuint source_texture, bool bFromZBuffer, bool bIsIntensityFmt, int bScaleByHalf, const EFBRectangle& source);
}