mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +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]);
|
values[i].u = convertData<uint32>((*constarray)[i]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case glslang::EbtInt:
|
|
||||||
case glslang::EbtBool:
|
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:
|
default:
|
||||||
u.dataType = DATA_BASETYPE_INT;
|
u.dataType = DATA_BASETYPE_INT;
|
||||||
if (constarray != nullptr)
|
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);
|
std::string name = basename + comp.get_member_name(type.self, uindex);
|
||||||
|
|
||||||
|
if (name == "Debug")
|
||||||
|
float x = 1.0f;
|
||||||
|
|
||||||
switch (memberType.basetype)
|
switch (memberType.basetype)
|
||||||
{
|
{
|
||||||
case SPIRType::Struct:
|
case SPIRType::Struct:
|
||||||
@@ -656,6 +659,9 @@ void Shader::buildLocalUniforms(spirv_cross::Compiler &comp, const spirv_cross::
|
|||||||
if (reflectionIt != validationReflection.localUniforms.end())
|
if (reflectionIt != validationReflection.localUniforms.end())
|
||||||
{
|
{
|
||||||
const auto &localUniform = reflectionIt->second;
|
const auto &localUniform = reflectionIt->second;
|
||||||
|
if (localUniform.dataType == DATA_BASETYPE_BOOL)
|
||||||
|
u.baseType = UNIFORM_BOOL;
|
||||||
|
|
||||||
const auto &values = localUniform.initializerValues;
|
const auto &values = localUniform.initializerValues;
|
||||||
if (!values.empty())
|
if (!values.empty())
|
||||||
memcpy(
|
memcpy(
|
||||||
|
|||||||
Reference in New Issue
Block a user