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

Function read_resource_size

framework/spirv_reflection.cpp:117–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117inline void read_resource_size(const spirv_cross::Compiler &compiler,
118 const spirv_cross::Resource &resource,
119 ShaderResource & shader_resource,
120 const ShaderVariant & variant)
121{
122 const auto &spirv_type = compiler.get_type_from_variable(resource.id);
123
124 size_t array_size = 0;
125 if (variant.get_runtime_array_sizes().count(resource.name) != 0)
126 {
127 array_size = variant.get_runtime_array_sizes().at(resource.name);
128 }
129
130 shader_resource.size = to_u32(compiler.get_declared_struct_size_runtime_array(spirv_type, array_size));
131}
132
133inline void read_resource_size(const spirv_cross::Compiler & compiler,
134 const spirv_cross::SPIRConstant &constant,

Callers 4

BufferUniform>Method · 0.85
BufferStorage>Method · 0.85
parse_push_constantsMethod · 0.85

Calls 2

to_u32Function · 0.85
get_typeMethod · 0.45

Tested by

no test coverage detected