mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
hlsl-out: omit globals that aren't accessible
This commit is contained in:
committed by
Dzmitry Malyshau
parent
3c98cc5ae1
commit
37d094ca07
@@ -339,6 +339,18 @@ impl<'a, W: Write> Writer<'a, W> {
|
||||
let global = &module.global_variables[handle];
|
||||
let inner = &module.types[global.ty].inner;
|
||||
|
||||
if let Some(ref binding) = global.binding {
|
||||
if let Err(err) = self.options.resolve_resource_binding(binding) {
|
||||
log::info!(
|
||||
"Skipping global {:?} (name {:?}) for being inaccessible: {}",
|
||||
handle,
|
||||
global.name,
|
||||
err,
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
// https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-variable-register
|
||||
let (storage, register_ty) = match global.class {
|
||||
crate::StorageClass::Function => unreachable!("Function storage class"),
|
||||
|
||||
Reference in New Issue
Block a user