MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / BufferStorage>

Method BufferStorage>

framework/spirv_reflection.cpp:349–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347
348template <>
349inline void read_shader_resource<ShaderResourceType::BufferStorage>(const spirv_cross::Compiler &compiler,
350 VkShaderStageFlagBits stage,
351 std::vector<ShaderResource> &resources,
352 const ShaderVariant & variant)
353{
354 auto storage_resources = compiler.get_shader_resources().storage_buffers;
355
356 for (auto &resource : storage_resources)
357 {
358 ShaderResource shader_resource;
359 shader_resource.type = ShaderResourceType::BufferStorage;
360 shader_resource.stages = stage;
361 shader_resource.name = resource.name;
362
363 read_resource_size(compiler, resource, shader_resource, variant);
364 read_resource_array_size(compiler, resource, shader_resource, variant);
365 read_resource_decoration<spv::DecorationNonReadable>(compiler, resource, shader_resource, variant);
366 read_resource_decoration<spv::DecorationNonWritable>(compiler, resource, shader_resource, variant);
367 read_resource_decoration<spv::DecorationDescriptorSet>(compiler, resource, shader_resource, variant);
368 read_resource_decoration<spv::DecorationBinding>(compiler, resource, shader_resource, variant);
369
370 resources.push_back(shader_resource);
371 }
372}
373} // namespace
374
375bool SPIRVReflection::reflect_shader_resources(VkShaderStageFlagBits stage, const std::vector<uint32_t> &spirv, std::vector<ShaderResource> &resources, const ShaderVariant &variant)

Callers

nothing calls this directly

Calls 2

read_resource_sizeFunction · 0.85
read_resource_array_sizeFunction · 0.85

Tested by

no test coverage detected