mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-13 15:59:23 +01:00
OGL: Remove TCache::Entry usage in TextureConverter
This commit is contained in:
parent
3df344ed38
commit
495902787c
@ -272,7 +272,11 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dstPointer, unsigned int ds
|
|||||||
{
|
{
|
||||||
TextureConverter::EncodeToRamFromTexture(
|
TextureConverter::EncodeToRamFromTexture(
|
||||||
dstPointer,
|
dstPointer,
|
||||||
this,
|
format,
|
||||||
|
native_width,
|
||||||
|
BytesPerRow(),
|
||||||
|
NumBlocksY(),
|
||||||
|
memory_stride,
|
||||||
read_texture,
|
read_texture,
|
||||||
srcFormat == PEControl::Z24,
|
srcFormat == PEControl::Z24,
|
||||||
isIntensity,
|
isIntensity,
|
||||||
|
@ -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)
|
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();
|
texconv_shader.Bind();
|
||||||
glUniform4i(s_encodingUniforms[texture_entry->format],
|
glUniform4i(s_encodingUniforms[format],
|
||||||
source.left, source.top, texture_entry->native_width, bScaleByHalf ? 2 : 1);
|
source.left, source.top, native_width, bScaleByHalf ? 2 : 1);
|
||||||
|
|
||||||
EncodeToRamUsingShader(source_texture,
|
EncodeToRamUsingShader(source_texture,
|
||||||
dest_ptr, texture_entry->BytesPerRow(), texture_entry->NumBlocksY(),
|
dest_ptr, bytes_per_row, num_blocks_y,
|
||||||
texture_entry->memory_stride, bScaleByHalf > 0 && !bFromZBuffer);
|
memory_stride, bScaleByHalf > 0 && !bFromZBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EncodeToRamYUYV(GLuint srcTexture, const TargetRectangle& sourceRc, u8* destAddr, u32 dstWidth, u32 dstStride, u32 dstHeight)
|
void EncodeToRamYUYV(GLuint srcTexture, const TargetRectangle& sourceRc, u8* destAddr, u32 dstWidth, u32 dstStride, u32 dstHeight)
|
||||||
|
@ -26,7 +26,7 @@ void EncodeToRamYUYV(GLuint srcTexture, const TargetRectangle& sourceRc,
|
|||||||
void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTexture);
|
void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTexture);
|
||||||
|
|
||||||
// returns size of the encoded data (in bytes)
|
// 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);
|
GLuint source_texture, bool bFromZBuffer, bool bIsIntensityFmt, int bScaleByHalf, const EFBRectangle& source);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user