From 0e7fdb30f24c1da1264bb8b64218e88771843ad8 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Tue, 30 Mar 2021 12:32:59 +0300 Subject: [PATCH] `#[spirv(uniform)]` is actually immutable in the absence of `BufferBlock`. (#558) --- crates/rustc_codegen_spirv/src/codegen_cx/entry.rs | 1 + crates/spirv-builder/src/test/basic.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs index 17c0e9e41a..c402cef864 100644 --- a/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs +++ b/crates/rustc_codegen_spirv/src/codegen_cx/entry.rs @@ -246,6 +246,7 @@ impl<'tcx> CodegenCx<'tcx> { let expected_mutbl = match storage_class { StorageClass::UniformConstant | StorageClass::Input + | StorageClass::Uniform | StorageClass::PushConstant => hir::Mutability::Not, _ => hir::Mutability::Mut, diff --git a/crates/spirv-builder/src/test/basic.rs b/crates/spirv-builder/src/test/basic.rs index c90e8dd693..f3c49fa542 100644 --- a/crates/spirv-builder/src/test/basic.rs +++ b/crates/spirv-builder/src/test/basic.rs @@ -463,7 +463,7 @@ fn index_user_dst() { r#" #[spirv(fragment)] pub fn main( - #[spirv(uniform, descriptor_set = 0, binding = 0)] slice: &mut SliceF32, + #[spirv(uniform, descriptor_set = 0, binding = 0)] slice: &SliceF32, ) { let float: f32 = slice.rta[0]; let _ = float;