GLSL: Fix atomic_uint being incorrectly generated as uint

This commit is contained in:
penghaiyi 2024-02-23 09:33:08 +08:00
parent b8fcf307f1
commit 18cb2ce961
2 changed files with 2 additions and 2 deletions

View File

@ -1227,7 +1227,7 @@ const SPIRType &Compiler::get_pointee_type(uint32_t type_id) const
uint32_t Compiler::get_variable_data_type_id(const SPIRVariable &var) const
{
if (var.phi_variable)
if (var.phi_variable || var.storage == spv::StorageClass::StorageClassAtomicCounter)
return var.basetype;
return get_pointee_type_id(var.basetype);
}

View File

@ -2568,7 +2568,7 @@ const char *CompilerGLSL::to_storage_qualifiers_glsl(const SPIRVariable &var)
return var.storage == StorageClassInput ? "in " : "out ";
}
else if (var.storage == StorageClassUniformConstant || var.storage == StorageClassUniform ||
var.storage == StorageClassPushConstant)
var.storage == StorageClassPushConstant || var.storage == StorageClassAtomicCounter)
{
return "uniform ";
}