Skip to content

Commit b2ab4b6

Browse files
committed
Warn when loading non-2D shaders before map
Since the necessity of sRGB conversions is not known.
1 parent 6ad2144 commit b2ab4b6

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/engine/client/cl_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,7 @@ bool CL_InitRenderer()
21432143
FS_FCloseFile( f );
21442144
}
21452145

2146-
cls.whiteShader = re.RegisterShader( "white", RSF_NOMIP );
2146+
cls.whiteShader = re.RegisterShader( "white", RSF_NOMIP | RSF_2D );
21472147

21482148
g_console_field_width = cls.glconfig.vidWidth / SMALLCHAR_WIDTH - 2;
21492149
g_consoleField.SetWidth(g_console_field_width);

src/engine/client/client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ struct clientStatic_t
315315
glconfig_t glconfig;
316316
glconfig2_t glconfig2;
317317
qhandle_t charSetShader;
318-
qhandle_t whiteShader;
318+
qhandle_t whiteShader; // used for console drawing
319319
bool useLegacyConsoleFont;
320320
bool useLegacyConsoleFace;
321321
fontInfo_t *consoleFont;

src/engine/renderer/tr_shader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6092,6 +6092,11 @@ shader_t *R_FindShader( const char *name, int flags )
60926092
// going to have to upload an image
60936093
R_SyncRenderThread();
60946094

6095+
if ( !( flags & RSF_2D ) && !tr.worldMapLoaded )
6096+
{
6097+
Log::Warn( "non-2D shader '%s' registered before map colorspace is known, assuming naive blending", name );
6098+
}
6099+
60956100
ClearGlobalShader();
60966101

60976102
Q_strncpyz( shader.name, strippedName, sizeof( shader.name ) );

0 commit comments

Comments
 (0)