summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/TextureCache.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2015-01-11 22:47:40 +0100
committerdegasus <wickmarkus@web.de>2015-01-11 22:47:40 +0100
commit728431256853989b63b963fc4816cf255b6ec382 (patch)
treeafb98115e9605f00e90eec0f78873f97c9b903c2 /Source/Core/VideoBackends/OGL/TextureCache.cpp
parenta9eb08b85da62944c1cde1594239a19af4559d02 (diff)
OGL: Warn about wrong texture sizes
Diffstat (limited to 'Source/Core/VideoBackends/OGL/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/TextureCache.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/OGL/TextureCache.cpp b/Source/Core/VideoBackends/OGL/TextureCache.cpp
index 4bf70271d1..241b73f719 100644
--- a/Source/Core/VideoBackends/OGL/TextureCache.cpp
+++ b/Source/Core/VideoBackends/OGL/TextureCache.cpp
@@ -188,6 +188,12 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(unsigned int width, u
void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height,
unsigned int expanded_width, unsigned int level)
{
+ if (level >= config.levels)
+ PanicAlert("Texture only has %d levels, can't update level %d", config.levels, level);
+ if (width != std::max(1u, config.width >> level) || height != std::max(1u, config.height >> level))
+ PanicAlert("size of level %d must be %dx%d, but %dx%d requested",
+ level, std::max(1u, config.width >> level), std::max(1u, config.height >> level), width, height);
+
if (pcfmt != PC_TEX_FMT_DXT1)
{
glActiveTexture(GL_TEXTURE0+9);