mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[glsl-in] Add support for interface blocks
This commit is contained in:
committed by
Dzmitry Malyshau
parent
8618a8a207
commit
973cfbc5d3
@@ -1071,7 +1071,29 @@ pomelo! {
|
||||
);
|
||||
if let Some(id) = id {
|
||||
extra.lookup_global_variables.insert(id, h);
|
||||
} else {
|
||||
// variables in interface blocks without an instance name are in the global namespace
|
||||
// https://www.khronos.org/opengl/wiki/Interface_Block_(GLSL)
|
||||
if let TypeInner::Struct { members } = &extra.module.types[d.ty].inner {
|
||||
for m in members {
|
||||
if let Some(name) = &m.name {
|
||||
let h = extra
|
||||
.module
|
||||
.global_variables
|
||||
.fetch_or_append(GlobalVariable {
|
||||
name: Some(name.into()),
|
||||
class,
|
||||
binding: binding.clone(),
|
||||
ty: m.ty,
|
||||
interpolation,
|
||||
storage_access: StorageAccess::empty(), // TODO
|
||||
});
|
||||
extra.lookup_global_variables.insert(name.into(), h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user