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

Method reflect_shader_resources

framework/spirv_reflection.cpp:375–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373} // namespace
374
375bool SPIRVReflection::reflect_shader_resources(VkShaderStageFlagBits stage, const std::vector<uint32_t> &spirv, std::vector<ShaderResource> &resources, const ShaderVariant &variant)
376{
377 spirv_cross::CompilerGLSL compiler{spirv};
378
379 auto opts = compiler.get_common_options();
380 opts.enable_420pack_extension = true;
381
382 compiler.set_common_options(opts);
383
384 parse_shader_resources(compiler, stage, resources, variant);
385 parse_push_constants(compiler, stage, resources, variant);
386 parse_specialization_constants(compiler, stage, resources, variant);
387
388 return true;
389}
390
391void SPIRVReflection::parse_shader_resources(const spirv_cross::Compiler &compiler, VkShaderStageFlagBits stage, std::vector<ShaderResource> &resources, const ShaderVariant &variant)
392{

Callers 1

ShaderModuleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected