summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/TextureCache.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2017-04-16 19:45:22 +1000
committerStenzek <stenzek@gmail.com>2017-04-29 00:14:23 +1000
commitf4b848949c67ffe99db61e5f4d0b968154e6c5ba (patch)
tree8a0a4709aa615f3f46117ff13712d21d3eda6103 /Source/Core/VideoBackends/OGL/TextureCache.cpp
parentbc8a96d713eb0a1fb565f121a5d939b99c2295fa (diff)
TextureCache: Support compressed textures and pass pitch/size to upload
This also removes an extra copy of the image for custom textures.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/TextureCache.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp
index 3bf1342809..e49483a593 100644
--- a/Source/Core/VideoBackends/OGL/TextureCache.cpp
+++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp
@@ -202,8 +202,8 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(const TCacheEntryBase*
g_renderer->RestoreAPIState();
}
-void TextureCache::TCacheEntry::Load(const u8* buffer, u32 width, u32 height, u32 expanded_width,
- u32 level)
+void TextureCache::TCacheEntry::Load(u32 level, u32 width, u32 height, u32 row_length,
+ const u8* buffer, size_t buffer_size)
{
if (level >= config.levels)
PanicAlert("Texture only has %d levels, can't update level %d", config.levels, level);
@@ -216,8 +216,8 @@ void TextureCache::TCacheEntry::Load(const u8* buffer, u32 width, u32 height, u3
glActiveTexture(GL_TEXTURE9);
glBindTexture(GL_TEXTURE_2D_ARRAY, texture);
- if (expanded_width != width)
- glPixelStorei(GL_UNPACK_ROW_LENGTH, expanded_width);
+ if (row_length != width)
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, row_length);
if (g_ogl_config.bSupportsTextureStorage)
{
@@ -230,7 +230,7 @@ void TextureCache::TCacheEntry::Load(const u8* buffer, u32 width, u32 height, u3
GL_UNSIGNED_BYTE, buffer);
}
- if (expanded_width != width)
+ if (row_length != width)
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
TextureCache::SetStage();