Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unused storage classes #1142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions crates/rustc_codegen_spirv/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,9 @@ const BUILTINS: &[(&str, BuiltIn)] = {
const STORAGE_CLASSES: &[(&str, StorageClass)] = {
use StorageClass::*;
&[
("uniform_constant", UniformConstant),
("input", Input),
("uniform", Uniform),
("output", Output),
("workgroup", Workgroup),
("cross_workgroup", CrossWorkgroup),
("private", Private),
("function", Function),
("generic", Generic),
("push_constant", PushConstant),
("atomic_counter", AtomicCounter),
("image", Image),
Expand Down
1 change: 0 additions & 1 deletion tests/ui/spirv-attr/bad-deduce-storage-class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use spirv_std::{spirv, Image};
#[spirv(vertex)]
pub fn main(
#[spirv(uniform)] error: &Image!(2D, type=f32),
#[spirv(uniform_constant)] warning: &Image!(2D, type=f32),
) {
}

Expand Down
12 changes: 3 additions & 9 deletions tests/ui/spirv-attr/bad-deduce-storage-class.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ help: remove storage class attribute to use `UniformConstant` as storage class
8 | #[spirv(uniform)] error: &Image!(2D, type=f32),
| ^^^^^^^

warning: redundant storage class attribute, storage class is deduced from type
--> $DIR/bad-deduce-storage-class.rs:9:13
|
9 | #[spirv(uniform_constant)] warning: &Image!(2D, type=f32),
| ^^^^^^^^^^^^^^^^

error: entry parameter type must be by-reference: `&spirv_std::image::Image<f32, 1, 2, 0, 0, 0, 0, 4>`
--> $DIR/bad-deduce-storage-class.rs:15:27
--> $DIR/bad-deduce-storage-class.rs:14:27
|
15 | pub fn issue_585(invalid: Image!(2D, type=f32)) {}
14 | pub fn issue_585(invalid: Image!(2D, type=f32)) {}
| ^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `Image` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors; 1 warning emitted
error: aborting due to 2 previous errors

15 changes: 0 additions & 15 deletions tests/ui/spirv-attr/invalid-storage-class.rs

This file was deleted.

32 changes: 0 additions & 32 deletions tests/ui/spirv-attr/invalid-storage-class.stderr

This file was deleted.

1 change: 0 additions & 1 deletion tests/ui/storage_class/mutability-errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use spirv_std::{image::Image2d, spirv};
#[spirv(fragment)]
pub fn main(
#[spirv(descriptor_set = 0, binding = 0)] implicit_uniform_constant_mut: &mut Image2d,
#[spirv(uniform_constant, descriptor_set = 0, binding = 0)] uniform_constant_mut: &mut Image2d,
#[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_mut: &mut u32,
#[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_interior_mut: &AtomicU32,
#[spirv(push_constant)] push_constant_mut: &mut u32,
Expand Down
52 changes: 17 additions & 35 deletions tests/ui/storage_class/mutability-errors.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,53 @@ note: ...but storage class `UniformConstant` is read-only
10 | #[spirv(descriptor_set = 0, binding = 0)] implicit_uniform_constant_mut: &mut Image2d,
| ^^^^^^^^^^^^ `UniformConstant` deduced from type

warning: redundant storage class attribute, storage class is deduced from type
--> $DIR/mutability-errors.rs:11:13
|
11 | #[spirv(uniform_constant, descriptor_set = 0, binding = 0)] uniform_constant_mut: &mut Image2d,
| ^^^^^^^^^^^^^^^^

error: entry-point requires a mutable reference...
--> $DIR/mutability-errors.rs:11:87
--> $DIR/mutability-errors.rs:11:69
|
11 | #[spirv(uniform_constant, descriptor_set = 0, binding = 0)] uniform_constant_mut: &mut Image2d,
| ^^^^^^^^^^^^
|
note: ...but storage class `UniformConstant` is read-only
--> $DIR/mutability-errors.rs:11:13
|
11 | #[spirv(uniform_constant, descriptor_set = 0, binding = 0)] uniform_constant_mut: &mut Image2d,
| ^^^^^^^^^^^^^^^^ `UniformConstant` specified in attribute

error: entry-point requires a mutable reference...
--> $DIR/mutability-errors.rs:12:69
|
12 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_mut: &mut u32,
11 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_mut: &mut u32,
| ^^^^^^^^
|
note: ...but storage class `Uniform` is read-only
--> $DIR/mutability-errors.rs:12:13
--> $DIR/mutability-errors.rs:11:13
|
12 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_mut: &mut u32,
11 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_mut: &mut u32,
| ^^^^^^^ `Uniform` specified in attribute

error: entry-point requires interior mutability...
--> $DIR/mutability-errors.rs:13:78
--> $DIR/mutability-errors.rs:12:78
|
13 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_interior_mut: &AtomicU32,
12 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_interior_mut: &AtomicU32,
| ^^^^^^^^^^
|
note: ...but storage class `Uniform` is read-only
--> $DIR/mutability-errors.rs:13:13
--> $DIR/mutability-errors.rs:12:13
|
13 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_interior_mut: &AtomicU32,
12 | #[spirv(uniform, descriptor_set = 0, binding = 0)] uniform_interior_mut: &AtomicU32,
| ^^^^^^^ `Uniform` specified in attribute

error: entry-point requires a mutable reference...
--> $DIR/mutability-errors.rs:14:48
--> $DIR/mutability-errors.rs:13:48
|
14 | #[spirv(push_constant)] push_constant_mut: &mut u32,
13 | #[spirv(push_constant)] push_constant_mut: &mut u32,
| ^^^^^^^^
|
note: ...but storage class `PushConstant` is read-only
--> $DIR/mutability-errors.rs:14:13
--> $DIR/mutability-errors.rs:13:13
|
14 | #[spirv(push_constant)] push_constant_mut: &mut u32,
13 | #[spirv(push_constant)] push_constant_mut: &mut u32,
| ^^^^^^^^^^^^^ `PushConstant` specified in attribute

error: entry-point requires interior mutability...
--> $DIR/mutability-errors.rs:15:57
--> $DIR/mutability-errors.rs:14:57
|
15 | #[spirv(push_constant)] push_constant_interior_mut: &AtomicU32,
14 | #[spirv(push_constant)] push_constant_interior_mut: &AtomicU32,
| ^^^^^^^^^^
|
note: ...but storage class `PushConstant` is read-only
--> $DIR/mutability-errors.rs:15:13
--> $DIR/mutability-errors.rs:14:13
|
15 | #[spirv(push_constant)] push_constant_interior_mut: &AtomicU32,
14 | #[spirv(push_constant)] push_constant_interior_mut: &AtomicU32,
| ^^^^^^^^^^^^^ `PushConstant` specified in attribute

error: aborting due to 6 previous errors; 1 warning emitted
error: aborting due to 5 previous errors