mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
shaders: texture3D() causes a deprecation warning, similar to texture2D()
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user