shaders: texture3D() causes a deprecation warning, similar to texture2D()

This commit is contained in:
Sasha Szpakowski
2026-03-31 20:03:57 -03:00
parent 762672882e
commit e01908e342
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -151,14 +151,17 @@ float Texel(sampler2DArrayShadow s, highp vec4 c) { return texture(s, c); }
uniform mediump float deprecatedTextureCall;
vec4 texture2DDeprecated(sampler2D s, vec2 c) { return texture(s, c) + deprecatedTextureCall; }
vec4 texture3DDeprecated(sampler3D s, vec3 c) { return texture(s, c) + deprecatedTextureCall; }
vec4 textureCubeDeprecated(samplerCube s, vec3 c) { return texture(s, c) + deprecatedTextureCall; }
#ifdef PIXEL
vec4 texture2DDeprecated(sampler2D s, vec2 c, float b) { return texture(s, c, b) + deprecatedTextureCall; }
vec4 texture3DDeprecated(sampler3D s, vec3 c, float b) { return texture(s, c, b) + deprecatedTextureCall; }
vec4 textureCubeDeprecated(samplerCube s, vec3 c, float b) { return texture(s, c, b) + deprecatedTextureCall; }
#endif
#define texture2D texture2DDeprecated
#define texture3D texture3DDeprecated
#define textureCube textureCubeDeprecated
float gammaToLinearPrecise(float c) {
+2 -2
View File
@@ -1602,7 +1602,7 @@ int w_newShader(lua_State *L)
{
Shader *shader = instance()->newShader(stages, options);
if (shader->isUsingDeprecatedTextureFunctions())
luax_markdeprecated(L, 1, "texture2D() or textureCube() function calls in shader code", API_CUSTOM, DEPRECATED_REPLACED, "texture() function calls");
luax_markdeprecated(L, 1, "texture2D() or texture3D() or textureCube() function calls in shader code", API_CUSTOM, DEPRECATED_REPLACED, "texture() function calls");
if (shader->isUsingDeprecatedTextureUniform())
luax_markdeprecated(L, 1, "'texture' uniform variable name in shader code", API_CUSTOM, DEPRECATED_NO_REPLACEMENT, "");
if (!shader->getUnsetVertexInputLocationsString().empty())
@@ -1640,7 +1640,7 @@ int w_newComputeShader(lua_State* L)
{
Shader *shader = instance()->newComputeShader(stages[0], options);
if (shader->isUsingDeprecatedTextureFunctions())
luax_markdeprecated(L, 1, "texture2D() or textureCube() function calls in shader code", API_CUSTOM, DEPRECATED_REPLACED, "texture() function calls");
luax_markdeprecated(L, 1, "texture2D() or texture3D() or textureCube() function calls in shader code", API_CUSTOM, DEPRECATED_REPLACED, "texture() function calls");
if (shader->isUsingDeprecatedTextureUniform())
luax_markdeprecated(L, 1, "'texture' uniform variable name in shader code", API_CUSTOM, DEPRECATED_NO_REPLACEMENT, "");
if (!shader->getUnsetVertexInputLocationsString().empty())