mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
consider the max 3d texture size on possible texture re-sampling
This commit is contained in:
parent
9e67ac0b9e
commit
752a38ccfe
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue