Skip to content

Commit 548e072

Browse files
committed
NUKE RGBA16 format handling
This was used for the color buffer in a previous iteration of overbright.
1 parent 3c925c7 commit 548e072

File tree

5 files changed

+0
-103
lines changed

5 files changed

+0
-103
lines changed

src/engine/renderer/tr_image.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -923,18 +923,6 @@ void R_UploadImage( const char *name, const byte **dataArray, int numLayers, int
923923
format = GL_DEPTH_STENCIL;
924924
internalFormat = GL_DEPTH24_STENCIL8;
925925
}
926-
else if ( image->bits & IF_RGBA16 )
927-
{
928-
if ( !glConfig2.textureRGBA16BlendAvailable )
929-
{
930-
Log::Warn("RGBA16 image '%s' cannot be blended", image->name );
931-
internalFormat = GL_RGBA8;
932-
}
933-
else
934-
{
935-
internalFormat = GL_RGBA16;
936-
}
937-
}
938926
else if ( image->bits & ( IF_RGBA16F | IF_RGBA32F | IF_TWOCOMP16F | IF_TWOCOMP32F | IF_ONECOMP16F | IF_ONECOMP32F ) )
939927
{
940928
if( !glConfig2.textureFloatAvailable ) {

src/engine/renderer/tr_init.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,20 +1047,6 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p
10471047
Log::Notice("%sMissing GPU vertex skinning, models are not hardware-accelerated.", Color::ToString( Color::Red ) );
10481048
}
10491049

1050-
switch ( glConfig2.textureRGBA16BlendAvailable )
1051-
{
1052-
case 1:
1053-
Log::Notice( "%sUsing GL_RGBA16 with GL_FRAMEBUFFER_BLEND.", Color::ToString( Color::Green ) );
1054-
break;
1055-
case -1:
1056-
Log::Notice( "%sUsing GL_RGBA16 with GL_FRAMEBUFFER_BLEND (assumed to be available).", Color::ToString( Color::Yellow ) );
1057-
break;
1058-
default:
1059-
case 0:
1060-
Log::Notice( "%sMissing GL_RGBA16 with GL_FRAMEBUFFER_BLEND.", Color::ToString( Color::Red ) );
1061-
break;
1062-
}
1063-
10641050
if ( glConfig.smpActive )
10651051
{
10661052
Log::Notice("Using dual processor acceleration." );

src/engine/renderer/tr_local.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,6 @@ enum class ssaoMode {
473473
IF_DEPTH32 = BIT( 11 ),
474474
IF_PACKED_DEPTH24_STENCIL8 = BIT( 12 ),
475475
IF_LIGHTMAP = BIT( 13 ),
476-
IF_RGBA16 = BIT( 14 ),
477476
IF_RGBE = BIT( 15 ),
478477
IF_ALPHATEST = BIT( 16 ), // FIXME: this is unused
479478
IF_ALPHA = BIT( 17 ),

src/engine/renderer/tr_public.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,8 @@ struct glconfig2_t
8787
int maxTexIndirections;
8888

8989
bool drawBuffersAvailable;
90-
bool internalFormatQuery2Available;
9190
bool textureHalfFloatAvailable;
9291
bool textureFloatAvailable;
93-
int textureRGBA16BlendAvailable;
9492
bool textureIntegerAvailable;
9593
bool textureRGAvailable;
9694
bool computeShaderAvailable;

src/engine/sys/sdl_glimp.cpp

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@ static Cvar::Cvar<bool> workaround_glDriver_amd_oglp_disableBindlessTexture(
135135
"workaround.glDriver.amd.oglp.disableBindlessTexture",
136136
"Disable ARB_bindless_texture on AMD OGLP driver",
137137
Cvar::NONE, true );
138-
static Cvar::Cvar<bool> workaround_glDriver_mesa_ati_rv300_disableRgba16Blend(
139-
"workaround.glDriver.mesa.ati.rv300.disableRgba16Blend",
140-
"Disable misdetected RGBA16 on Mesa driver on RV300 hardware",
141-
Cvar::NONE, true );
142138
static Cvar::Cvar<bool> workaround_glDriver_mesa_ati_rv300_useFloatVertex(
143139
"workaround.glDriver.mesa.ati.rv300.useFloatVertex",
144140
"Use float vertex instead of supported-but-slower half-float vertex on Mesa driver on ATI RV300 hardware",
@@ -2108,75 +2104,6 @@ static void GLimp_InitExtensions()
21082104
// made required in OpenGL 3.0
21092105
glConfig2.textureFloatAvailable = LOAD_EXTENSION_WITH_TEST( ExtFlag_CORE, ARB_texture_float, r_ext_texture_float.Get() );
21102106

2111-
glConfig2.internalFormatQuery2Available = LOAD_EXTENSION_WITH_TEST( ExtFlag_NONE, ARB_internalformat_query2, r_arb_internalformat_query2.Get() );
2112-
2113-
if ( glConfig2.internalFormatQuery2Available )
2114-
{
2115-
GLint64 param;
2116-
glGetInternalformati64v( GL_TEXTURE_2D, GL_RGBA16, GL_FRAMEBUFFER_BLEND, 1, &param );
2117-
2118-
if ( param == GL_FULL_SUPPORT || param == GL_TRUE )
2119-
{
2120-
/* There is a discrepancy between OpenGL specification and OpenGL reference pages.
2121-
2122-
The OpenGL 4.3 Core specification says the query should return either GL_FULL_SUPPORT,
2123-
GL_CAVEAT_SUPPORT, or GL_NONE:
2124-
2125-
- https://registry.khronos.org/OpenGL/specs/gl/glspec43.core.pdf#page=517
2126-
2127-
The ARB_internalformat_query2 document says the same:
2128-
2129-
- https://registry.khronos.org/OpenGL/extensions/ARB/ARB_internalformat_query2.txt
2130-
2131-
The OpenGL wiki page for glGetInternalformat says the same:
2132-
2133-
- https://www.khronos.org/opengl/wiki/GLAPI/glGetInternalformat
2134-
2135-
But the glGetInternalformat reference page says the query should return GL_TRUE
2136-
or GL_FALSE:
2137-
2138-
- https://registry.khronos.org/OpenGL-Refpages/gl4/html/glGetInternalformat.xhtml
2139-
2140-
The meaning of GL_CAVEAT_SUPPORT as a return of a GL_FRAMEBUFFER_BLEND query is
2141-
unknown. See this thread for details:
2142-
2143-
- https://github.com/KhronosGroup/OpenGL-Refpages/issues/157
2144-
2145-
Because of this discrepancy in documentation, drivers may have implemented
2146-
either GL_FULL_SUPPORT or GL_TRUE as a return for feature availability. */
2147-
glConfig2.textureRGBA16BlendAvailable = 1;
2148-
}
2149-
else if ( param == GL_CAVEAT_SUPPORT || param == GL_NONE )
2150-
{
2151-
/* Older Mesa versions were mistakenly reporting full support for every driver on
2152-
every hardware. A return that is not GL_FULL_SUPPORT and not GL_TRUE is the only
2153-
value we can trust. See those threads for details:
2154-
2155-
- https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30612
2156-
- https://gitlab.freedesktop.org/mesa/mesa/-/issues/11669#note_2521403
2157-
2158-
GL_FALSE has same value as GL_NONE. */
2159-
glConfig2.textureRGBA16BlendAvailable = 0;
2160-
}
2161-
}
2162-
else
2163-
{
2164-
/* Assume this is an old driver without the query extension but the RGBA16 blending is
2165-
available, as the feature is much older than the extension to check for it, the feature
2166-
is very likely supported. */
2167-
glConfig2.textureRGBA16BlendAvailable = -1;
2168-
}
2169-
2170-
/* Workaround for drivers not implementing the feature query or wrongly reporting the feature
2171-
to be supported, for various reasons. */
2172-
if ( workaround_glDriver_mesa_ati_rv300_disableRgba16Blend.Get() )
2173-
{
2174-
if ( glConfig2.textureRGBA16BlendAvailable != 0 && glConfig.hardwareType == glHardwareType_t::GLHW_R300 )
2175-
{
2176-
glConfig2.textureRGBA16BlendAvailable = 0;
2177-
}
2178-
}
2179-
21802107
bool gpuShader4Enabled = r_ext_gpu_shader4.Get();
21812108

21822109
if ( gpuShader4Enabled
@@ -2708,7 +2635,6 @@ bool GLimp_Init()
27082635

27092636
Cvar::Latch( workaround_glDriver_amd_adrenalin_disableBindlessTexture );
27102637
Cvar::Latch( workaround_glDriver_amd_oglp_disableBindlessTexture );
2711-
Cvar::Latch( workaround_glDriver_mesa_ati_rv300_disableRgba16Blend );
27122638
Cvar::Latch( workaround_glDriver_mesa_ati_rv300_useFloatVertex );
27132639
Cvar::Latch( workaround_glDriver_mesa_ati_rv600_disableHyperZ );
27142640
Cvar::Latch( workaround_glDriver_mesa_broadcom_vc4_useFloatVertex );

0 commit comments

Comments
 (0)