Просмотр исходного кода

shaderc: Fixed SPIRV outputting useless uniforms.

Бранимир Караџић 4 лет назад
Родитель
Сommit
e180849b89
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      tools/shaderc/shaderc_spirv.cpp

+ 6 - 0
tools/shaderc/shaderc_spirv.cpp

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