Merge pull request #4224 from lioncash/tcache

TextureCacheBase: Eliminate static state
This commit is contained in:
Mat M
2016-12-23 04:33:42 -05:00
committed by GitHub
21 changed files with 141 additions and 163 deletions

View File

@ -178,8 +178,8 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(const TCacheEntryBase*
g_renderer->RestoreAPIState();
}
void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height,
unsigned int expanded_width, unsigned int level)
void TextureCache::TCacheEntry::Load(const u8* buffer, u32 width, u32 height, u32 expanded_width,
u32 level)
{
if (level >= config.levels)
PanicAlert("Texture only has %d levels, can't update level %d", config.levels, level);
@ -196,7 +196,7 @@ void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height,
glPixelStorei(GL_UNPACK_ROW_LENGTH, expanded_width);
glTexImage3D(GL_TEXTURE_2D_ARRAY, level, GL_RGBA, width, height, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
temp);
buffer);
if (expanded_width != width)
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);