mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
vulkan: correctly identify boolean uniforms
This commit is contained in:
@@ -1010,8 +1010,16 @@ bool Shader::validateInternal(StrongRef<ShaderStage> stages[], std::string &err,
|
||||
values[i].u = convertData<uint32>((*constarray)[i]);
|
||||
}
|
||||
break;
|
||||
case glslang::EbtInt:
|
||||
case glslang::EbtBool:
|
||||
u.dataType = DATA_BASETYPE_BOOL;
|
||||
if (constarray != nullptr)
|
||||
{
|
||||
values.resize(constarray->size());
|
||||
for (int i = 0; i < constarray->size(); i++)
|
||||
values[i].u = convertData<uint32>((*constarray)[i]);
|
||||
}
|
||||
break;
|
||||
case glslang::EbtInt:
|
||||
default:
|
||||
u.dataType = DATA_BASETYPE_INT;
|
||||
if (constarray != nullptr)
|
||||
|
||||
@@ -614,6 +614,9 @@ void Shader::buildLocalUniforms(spirv_cross::Compiler &comp, const spirv_cross::
|
||||
|
||||
std::string name = basename + comp.get_member_name(type.self, uindex);
|
||||
|
||||
if (name == "Debug")
|
||||
float x = 1.0f;
|
||||
|
||||
switch (memberType.basetype)
|
||||
{
|
||||
case SPIRType::Struct:
|
||||
@@ -656,6 +659,9 @@ void Shader::buildLocalUniforms(spirv_cross::Compiler &comp, const spirv_cross::
|
||||
if (reflectionIt != validationReflection.localUniforms.end())
|
||||
{
|
||||
const auto &localUniform = reflectionIt->second;
|
||||
if (localUniform.dataType == DATA_BASETYPE_BOOL)
|
||||
u.baseType = UNIFORM_BOOL;
|
||||
|
||||
const auto &values = localUniform.initializerValues;
|
||||
if (!values.empty())
|
||||
memcpy(
|
||||
|
||||
Reference in New Issue
Block a user