Skip to content

Commit ffc920b

Browse files
authored
[hlsl-out] error on unimplemented non-struct push constants (gfx-rs#7545)
1 parent 62d4e82 commit ffc920b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

naga/src/back/hlsl/writer.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,15 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
966966
// Push constants need to be assigned a binding explicitly by the consumer
967967
// since naga has no way to know the binding from the shader alone
968968
if global.space == crate::AddressSpace::PushConstant {
969+
match module.types[global.ty].inner {
970+
TypeInner::Struct { .. } => {}
971+
_ => {
972+
return Err(Error::Unimplemented(format!(
973+
"push-constant '{name}' has non-struct type; tracked by: https://github.com/gfx-rs/wgpu/issues/5683"
974+
)));
975+
}
976+
}
977+
969978
let target = self
970979
.options
971980
.push_constants_target

0 commit comments

Comments
 (0)