Skip to content

Commit 7f9c569

Browse files
committed
renderer: disable texture3D on GL4ES
texture3D isn't supported by GL ES, so GL4ES cannot support it
1 parent 041d814 commit 7f9c569

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/engine/sys/sdl_glimp.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ static Cvar::Cvar<bool> workaround_glDriver_gl4es_disableMat3x2(
163163
"workaround.glDriver.gl4es.disableMat3x2",
164164
"Disable mat3x2 GLSL support on GL4ES",
165165
Cvar::NONE, true );
166+
static Cvar::Cvar<bool> workaround_glDriver_gl4es_disableTexture3D(
167+
"workaround.glDriver.gl4es.disableTexture3D",
168+
"Disable texture3D support on GL4ES",
169+
Cvar::NONE, true );
166170
static Cvar::Cvar<bool> workaround_glDriver_mesa_ati_rv300_useFloatVertex(
167171
"workaround.glDriver.mesa.ati.rv300.useFloatVertex",
168172
"Use float vertex instead of supported-but-slower half-float vertex on Mesa driver on ATI RV300 hardware",
@@ -2154,6 +2158,16 @@ static void GLimp_InitExtensions()
21542158
logger.Warn( "Missing 3D texture support because of null max size" );
21552159
}
21562160

2161+
if ( glConfig.driverVendor == glDriverVendor_t::GL4ES )
2162+
{
2163+
if ( glConfig.texture3DAvailable
2164+
&& workaround_glDriver_gl4es_disableTexture3D.Get() )
2165+
{
2166+
logger.Notice( "Found GL4ES translation layer with OpenGL ES backend, disable 3D texture support." );
2167+
glConfig.texture3DAvailable = false;
2168+
}
2169+
}
2170+
21572171
logger.Notice( "...using up to %d texture size.", glConfig.maxTextureSize );
21582172

21592173
if ( glConfig.texture3DAvailable )
@@ -2974,6 +2988,7 @@ bool GLimp_Init()
29742988
Cvar::Latch( workaround_glDriver_gl4es_assumeSmoothstep );
29752989
Cvar::Latch( workaround_glDriver_gl4es_disableIncrementalShaderCompilation );
29762990
Cvar::Latch( workaround_glDriver_gl4es_disableMat3x2 );
2991+
Cvar::Latch( workaround_glDriver_gl4es_disableTexture3D );
29772992
Cvar::Latch( workaround_glDriver_mesa_ati_rv300_useFloatVertex );
29782993
Cvar::Latch( workaround_glDriver_mesa_ati_rv600_disableHyperZ );
29792994
Cvar::Latch( workaround_glDriver_mesa_broadcom_vc4_useFloatVertex );

0 commit comments

Comments
 (0)