From 752a38ccfec6ac9d97dfa3d9ffd1755d110637f6 Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 22 Feb 2014 18:58:17 +0100 Subject: [PATCH] consider the max 3d texture size on possible texture re-sampling --- src/engine/client/backend_sdl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/engine/client/backend_sdl.cpp b/src/engine/client/backend_sdl.cpp index 052c686d5..2356f0c7a 100644 --- a/src/engine/client/backend_sdl.cpp +++ b/src/engine/client/backend_sdl.cpp @@ -258,6 +258,15 @@ void CCommandProcessorFragment_OpenGL::Cmd_Texture_Create(const CCommandBuffer:: { int MaxTexSize; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &MaxTexSize); + if(pCommand->m_Flags&CCommandBuffer::TEXFLAG_TEXTURE3D) + { + int Max3DTexSize; + glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &Max3DTexSize); + if(pCommand->m_Flags&CCommandBuffer::TEXFLAG_TEXTURE2D) + MaxTexSize = min(MaxTexSize, Max3DTexSize*16); + else + MaxTexSize = Max3DTexSize*16; + } if(Width > MaxTexSize || Height > MaxTexSize) { do