From 36d70aa30a19f9e2fc038b6f82ea193736527292 Mon Sep 17 00:00:00 2001 From: tomaz Date: Fri, 17 Sep 2010 22:58:16 +0000 Subject: [PATCH] Fix a couple HLSL shader warnings git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10474 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index 10397fd8..5a072b2a 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -2002,9 +2002,13 @@ const char *builtincgshaderstring = "float4 gl_MultiTexCoord0 : TEXCOORD0,\n" "float4 gl_MultiTexCoord1 : TEXCOORD1,\n" "out float4 gl_Position : POSITION,\n" -"out float4 gl_FrontColor : COLOR,\n" +"#ifdef USEDIFFUSE\n" "out float2 TexCoord1 : TEXCOORD0,\n" -"out float2 TexCoord2 : TEXCOORD1\n" +"#endif\n" +"#ifdef USESPECULAR\n" +"out float2 TexCoord2 : TEXCOORD1,\n" +"#endif\n" +"out float4 gl_FrontColor : COLOR\n" ")\n" "{\n" "#ifdef HLSL\n" @@ -2461,7 +2465,9 @@ const char *builtincgshaderstring = "uniform float3 EyePosition : register(c24),\n" "#endif\n" "out float4 gl_Position : POSITION,\n" +"#ifdef USEVERTEXTEXTUREBLEND\n" "out float4 gl_FrontColor : COLOR,\n" +"#endif\n" "out float4 TexCoordBoth : TEXCOORD0,\n" "#ifdef USEOFFSETMAPPING\n" "out float3 EyeVector : TEXCOORD2,\n" @@ -2735,8 +2741,9 @@ const char *builtincgshaderstring = "#ifdef USESHADOWMAPORTHO\n" "uniform float4x4 ShadowMapMatrix : register(c16),\n" "#endif\n" -"\n" +"#if defined(MODE_VERTEXCOLOR) || defined(USEVERTEXTEXTUREBLEND)\n" "out float4 gl_FrontColor : COLOR,\n" +"#endif\n" "out float4 TexCoordBoth : TEXCOORD0,\n" "#ifdef USELIGHTMAP\n" "out float2 TexCoordLightmap : TEXCOORD1,\n" @@ -2750,7 +2757,7 @@ const char *builtincgshaderstring = "#ifdef USEFOG\n" "out float4 EyeVectorModelSpaceFogPlaneVertexDist : TEXCOORD4,\n" "#endif\n" -"#if defined(MODE_LIGHTSOURCE) || defined(MODE_LIGHTDIRECTION)\n" +"#if defined(MODE_LIGHTDIRECTION) && defined(USEDIFFUSE) || defined(USEDIFFUSE)\n" "out float3 LightVector : TEXCOORD1,\n" "#endif\n" "#ifdef MODE_LIGHTSOURCE\n" -- 2.39.2