mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 13:48:30 +09:00
[Refactor] (MG_Backend/DirectVulkan/ProgramFactory): refactor uniform reflection
This commit is contained in:
@@ -179,7 +179,14 @@ namespace MobileGL {
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
if (bindings[i]->descriptor_type == SPV_REFLECT_DESCRIPTOR_TYPE_UNIFORM_BUFFER) {
|
||||
InterfaceVariable var;
|
||||
var.name = bindings[i]->name;
|
||||
// Use the block/type name (e.g. "MGL_GLOBAL_UBO") rather than
|
||||
// the variable name, which may be empty or meaningless for UBOs.
|
||||
// This is consistent with ParseMetaData() which uses type_description->type_name.
|
||||
if (bindings[i]->type_description && bindings[i]->type_description->type_name) {
|
||||
var.name = bindings[i]->type_description->type_name;
|
||||
} else {
|
||||
var.name = bindings[i]->name;
|
||||
}
|
||||
var.location = bindings[i]->binding;
|
||||
variables.push_back(var);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user