From 1e2a163daa6a95cd073febf6f674a76d8f2fe1eb Mon Sep 17 00:00:00 2001 From: eihrul Date: Tue, 13 Sep 2011 02:30:52 +0000 Subject: [PATCH] abstracted texture2DOffset usage to work around GLSL 130 deprecation warnings git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11346 d7cf8633-e32d-0410-b094-e92efae38249 --- shader_glsl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shader_glsl.h b/shader_glsl.h index d59744a4..b4f43c2c 100644 --- a/shader_glsl.h +++ b/shader_glsl.h @@ -16,6 +16,7 @@ "# define dp_offsetmapping_dFdx dFdx\n" "# define dp_offsetmapping_dFdy dFdy\n" "# define dp_textureGrad textureGrad\n" +"# define dp_textureOffset(a,b,c,d) textureOffset(a,b,ivec2(c,d))\n" "# define dp_texture2D texture\n" "# define dp_texture3D texture\n" "# define dp_textureCube texture\n" @@ -29,6 +30,7 @@ "# define dp_offsetmapping_dFdx(a) vec2(0.0, 0.0)\n" "# define dp_offsetmapping_dFdy(a) vec2(0.0, 0.0)\n" "# define dp_textureGrad(a,b,c,d) texture2D(a,b)\n" +"# define dp_textureOffset(a,b,c,d) texture2DOffset(a,b,ivec2(c,d))\n" "# define dp_texture2D texture2D\n" "# define dp_texture3D texture3D\n" "# define dp_textureCube textureCube\n" @@ -817,7 +819,7 @@ "# endif\n" "# else\n" "# ifdef GL_EXT_gpu_shader4\n" -"# define texval(x, y) texture2DOffset(Texture_ShadowMap2D, center, ivec2(x, y)).r\n" +"# define texval(x, y) dp_textureOffset(Texture_ShadowMap2D, center, x, y).r\n" "# else\n" "# define texval(x, y) dp_texture2D(Texture_ShadowMap2D, center + vec2(x, y)*ShadowMap_TextureScale).r \n" "# endif\n" -- 2.39.2