Skip to content

Commit 262423d

Browse files
committed
renderer: disable texture3D on GL4ES
texture3D isn't supported by GL ES, so GL4ES cannot support it
1 parent 40a07e7 commit 262423d

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
@@ -159,6 +159,10 @@ static Cvar::Cvar<bool> workaround_glDriver_gl4es_disableMat3x2(
159159
"workaround.glDriver.gl4es.disableMat3x2",
160160
"Disable mat3x2 GLSL support on GL4ES",
161161
Cvar::NONE, true );
162+
static Cvar::Cvar<bool> workaround_glDriver_gl4es_disableTexture3D(
163+
"workaround.glDriver.gl4es.disableTexture3D",
164+
"Disable texture3D support on GL4ES",
165+
Cvar::NONE, true );
162166
static Cvar::Cvar<bool> workaround_glDriver_mesa_ati_rv300_useFloatVertex(
163167
"workaround.glDriver.mesa.ati.rv300.useFloatVertex",
164168
"Use float vertex instead of supported-but-slower half-float vertex on Mesa driver on ATI RV300 hardware",
@@ -2150,6 +2154,16 @@ static void GLimp_InitExtensions()
21502154
logger.Warn( "Missing 3D texture support because of null max size" );
21512155
}
21522156

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

21552169
if ( glConfig.texture3DAvailable )
@@ -2962,6 +2976,7 @@ bool GLimp_Init()
29622976
Cvar::Latch( workaround_glDriver_amd_oglp_disableBindlessTexture );
29632977
Cvar::Latch( workaround_glDriver_gl4es_disableIncrementalShaderCompilation );
29642978
Cvar::Latch( workaround_glDriver_gl4es_disableMat3x2 );
2979+
Cvar::Latch( workaround_glDriver_gl4es_disableTexture3D );
29652980
Cvar::Latch( workaround_glDriver_mesa_ati_rv300_useFloatVertex );
29662981
Cvar::Latch( workaround_glDriver_mesa_ati_rv600_disableHyperZ );
29672982
Cvar::Latch( workaround_glDriver_mesa_broadcom_vc4_useFloatVertex );

0 commit comments

Comments
 (0)