consider the max 3d texture size on possible texture re-sampling

This commit is contained in:
oy 2014-02-22 18:58:17 +01:00
parent 9e67ac0b9e
commit 752a38ccfe

View file

@ -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