Fix OpenGL coordinate computation.

This commit is contained in:
magumagu 2015-01-25 21:38:30 -08:00
parent cb5d3fce4f
commit 1ee09ced0a
1 changed files with 7 additions and 5 deletions

View File

@ -320,14 +320,16 @@ int EncodeToRamFromTexture(u32 address,GLuint source_texture, bool bFromZBuffer,
source.left, source.top,
expandedWidth, bScaleByHalf ? 2 : 1);
int cacheBytes = 32;
unsigned int numBlocksX = expandedWidth / TexDecoder_GetBlockWidthInTexels(format);
unsigned int numBlocksY = expandedHeight / TexDecoder_GetBlockHeightInTexels(format);
unsigned int cacheLinesPerRow;
if ((format & 0x0f) == 6)
cacheBytes = 64;
cacheLinesPerRow = numBlocksX * 2;
else
cacheLinesPerRow = numBlocksX;
int readStride = (expandedWidth * cacheBytes) /
TexDecoder_GetBlockWidthInTexels(format);
EncodeToRamUsingShader(source_texture,
dest_ptr, expandedWidth / samples, expandedHeight, readStride,
dest_ptr, cacheLinesPerRow * 8, numBlocksY, cacheLinesPerRow * 32,
bScaleByHalf > 0 && !bFromZBuffer);
return size_in_bytes; // TODO: D3D11 is calculating this value differently!