mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-25 00:04:11 +00:00
Fix issue 585 (#594)
This commit is contained in:
parent
9679e615bd
commit
6c8dece25a
@ -177,7 +177,18 @@ impl<'tcx> CodegenCx<'tcx> {
|
||||
// Some types automatically specify a storage class. Compute that here.
|
||||
let inferred_storage_class_from_ty = match self.lookup_type(spirv_ty) {
|
||||
SpirvType::Image { .. } | SpirvType::Sampler | SpirvType::SampledImage { .. } => {
|
||||
Some(StorageClass::UniformConstant)
|
||||
if is_ref {
|
||||
Some(StorageClass::UniformConstant)
|
||||
} else {
|
||||
self.tcx.sess.span_err(
|
||||
hir_param.ty_span,
|
||||
&format!(
|
||||
"entry parameter type must be by-reference: `&{}`",
|
||||
layout.ty,
|
||||
),
|
||||
);
|
||||
None
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
|
@ -5,3 +5,7 @@ use spirv_std::Image2d;
|
||||
|
||||
#[spirv(vertex)]
|
||||
pub fn main(#[spirv(uniform)] error: &Image2d, #[spirv(uniform_constant)] warning: &Image2d) {}
|
||||
|
||||
// https://github.com/EmbarkStudios/rust-gpu/issues/585
|
||||
#[spirv(vertex)]
|
||||
pub fn issue_585(invalid: Image2d) {}
|
||||
|
@ -19,5 +19,11 @@ warning: redundant storage class specifier, storage class is inferred from type
|
||||
7 | pub fn main(#[spirv(uniform)] error: &Image2d, #[spirv(uniform_constant)] warning: &Image2d) {}
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
error: entry parameter type must be by-reference: `&spirv_std::Image2d`
|
||||
--> $DIR/bad-infer-storage-class.rs:11:27
|
||||
|
|
||||
11 | pub fn issue_585(invalid: Image2d) {}
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user