mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
In fact, lets just replace Shader:getUniformVariable with Shader:hasUniform. The latter returns true if the uniform with the specified name exists and contributes to the final output of the shader.
--HG-- branch : minor
This commit is contained in:
@@ -621,21 +621,9 @@ int Shader::getTextureUnit(const std::string &name)
|
||||
return texunit;
|
||||
}
|
||||
|
||||
Shader::UniformType Shader::getUniformVariable(const std::string &name, int &components, int &count)
|
||||
bool Shader::hasUniform(const std::string &name) const
|
||||
{
|
||||
auto it = uniforms.find(name);
|
||||
|
||||
if (it == uniforms.end())
|
||||
{
|
||||
components = 0;
|
||||
count = 0;
|
||||
return UNIFORM_UNKNOWN;
|
||||
}
|
||||
|
||||
components = getUniformTypeSize(it->second.type);
|
||||
count = (int) it->second.count;
|
||||
|
||||
return it->second.baseType;
|
||||
return uniforms.find(name) != uniforms.end();
|
||||
}
|
||||
|
||||
GLint Shader::getAttribLocation(const std::string &name)
|
||||
|
||||
Reference in New Issue
Block a user