diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/renderergl2/tr_glsl.c | 14 | ||||
-rw-r--r-- | src/renderergl2/tr_init.c | 4 | ||||
-rw-r--r-- | src/renderergl2/tr_local.h | 2 |
3 files changed, 16 insertions, 4 deletions
diff --git a/src/renderergl2/tr_glsl.c b/src/renderergl2/tr_glsl.c index 58a00e6e..ed078ddf 100644 --- a/src/renderergl2/tr_glsl.c +++ b/src/renderergl2/tr_glsl.c @@ -400,24 +400,30 @@ static int GLSL_LoadGPUShaderText(const char *name, const char *fallback, Com_sprintf(filename, sizeof(filename), "glsl/%s_fp.glsl", name); } - ri.Printf(PRINT_DEVELOPER, "...loading '%s'\n", filename); - size = ri.FS_ReadFile(filename, (void **)&buffer); + if ( r_externalGLSL->integer ) { + size = ri.FS_ReadFile(filename, (void **)&buffer); + } else { + size = 0; + buffer = NULL; + } + if(!buffer) { if (fallback) { - ri.Printf(PRINT_DEVELOPER, "couldn't load, using fallback\n"); + ri.Printf(PRINT_DEVELOPER, "...loading built-in '%s'\n", filename); shaderText = fallback; size = strlen(shaderText); } else { - ri.Printf(PRINT_DEVELOPER, "couldn't load!\n"); + ri.Printf(PRINT_DEVELOPER, "couldn't load '%s'\n", filename); return 0; } } else { + ri.Printf(PRINT_DEVELOPER, "...loading '%s'\n", filename); shaderText = buffer; } diff --git a/src/renderergl2/tr_init.c b/src/renderergl2/tr_init.c index f0f56616..51cd3b47 100644 --- a/src/renderergl2/tr_init.c +++ b/src/renderergl2/tr_init.c @@ -109,6 +109,8 @@ cvar_t *r_mergeLeafSurfaces; cvar_t *r_cameraExposure; +cvar_t *r_externalGLSL; + cvar_t *r_hdr; cvar_t *r_floatLightmap; cvar_t *r_postProcess; @@ -1094,6 +1096,8 @@ void R_Register( void ) r_greyscale = ri.Cvar_Get("r_greyscale", "0", CVAR_ARCHIVE | CVAR_LATCH); ri.Cvar_CheckRange(r_greyscale, 0, 1, qfalse); + r_externalGLSL = ri.Cvar_Get( "r_externalGLSL", "0", CVAR_LATCH ); + r_hdr = ri.Cvar_Get( "r_hdr", "1", CVAR_ARCHIVE | CVAR_LATCH ); r_floatLightmap = ri.Cvar_Get( "r_floatLightmap", "0", CVAR_ARCHIVE | CVAR_LATCH ); r_postProcess = ri.Cvar_Get( "r_postProcess", "1", CVAR_ARCHIVE ); diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index bc3a28ed..6ade112d 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1768,6 +1768,8 @@ extern cvar_t *r_anaglyphMode; extern cvar_t *r_mergeMultidraws; extern cvar_t *r_mergeLeafSurfaces; +extern cvar_t *r_externalGLSL; + extern cvar_t *r_hdr; extern cvar_t *r_floatLightmap; extern cvar_t *r_postProcess; |