shaderc: Fixed SPIRV outputting useless uniforms.

This commit is contained in:
Бранимир Караџић 2021-10-01 20:13:46 -07:00
parent 73db386165
commit e180849b89

View File

@ -636,6 +636,11 @@ namespace bgfx { namespace spirv
Uniform un; Uniform un;
un.name = program->getUniformName(ii); un.name = program->getUniformName(ii);
if (bx::hasSuffix(un.name.c_str(), ".@data") )
{
continue;
}
un.num = 0; un.num = 0;
const uint32_t offset = program->getUniformBufferOffset(ii); const uint32_t offset = program->getUniformBufferOffset(ii);
un.regIndex = uint16_t(offset); un.regIndex = uint16_t(offset);
@ -800,6 +805,7 @@ namespace bgfx { namespace spirv
for (auto& resource : resourcesrefl.storage_buffers) for (auto& resource : resourcesrefl.storage_buffers)
{ {
std::string name = refl.get_name(resource.id); std::string name = refl.get_name(resource.id);
uint32_t binding_index = refl.get_decoration(resource.id, spv::Decoration::DecorationBinding); uint32_t binding_index = refl.get_decoration(resource.id, spv::Decoration::DecorationBinding);
spirv_cross::Bitset flags = refl.get_buffer_block_flags(resource.id); spirv_cross::Bitset flags = refl.get_buffer_block_flags(resource.id);