rust-gpu/tests/ui/spirv-attr/multiple.rs
hatoo b0676cba61
Implement OpTypeMatrix (#738)
* Implement OpTypeMatrix

* clippy

* Use cached Symbol

* Implement #[spirv(matrix(ty, m, n))] instead of Matrix trait

* Update #[spirv(matrix(..))]

- #[spirv(matrix(ty, m, n))]
  Specify all of type, rows, columns.
- #[spirv(matrix(ty, m))]
  Specify all of type, rows. Infer columns.
- #[spirv(matrix(ty))]
  Specify all of type. Infer others.
- #[spirv(matrix)]
  Infer all.

* Drop #[spirv(matrix(..))] (with arguments)

* Fix IntrinsicType::Matrix type construction

* Update matrix-type.rs

* Update tests/ui/spirv-attr/multiple.rs to test Matrix

* Fix tests/ui/spirv-attr/matrix-type.rs

* Add failing tests for #[spirv(matrix)

* Update error messages for #[spirv(matrix)]
2021-08-30 15:45:29 +02:00

57 lines
1.3 KiB
Rust

// Tests that multiple `#[spirv(...)]` attributes that are either identical, or
// part of the same mutually exclusive category, are properly disallowed.
// build-fail
use spirv_std as _;
#[spirv(sampler, sampler)]
struct _SameIntrinsicType {}
#[spirv(matrix, matrix)]
struct _SameIntrinsicMatrixType {
x: glam::Vec3,
y: glam::Vec3,
}
#[spirv(sampler, generic_image_type)]
struct _DiffIntrinsicType {}
#[spirv(sampler, matrix)]
struct _SamplerAndMatrix {
x: glam::Vec3,
y: glam::Vec3,
}
#[spirv(block, block)]
struct _Block {}
#[spirv(vertex, vertex)]
fn _same_entry() {}
#[spirv(vertex, fragment)]
fn _diff_entry() {}
#[spirv(vertex)]
fn _entry(
#[spirv(uniform, uniform)] _same_storage_class: (),
#[spirv(uniform, push_constant)] _diff_storage_class: (),
#[spirv(position, position)] _same_builtin: (),
#[spirv(position, vertex_index)] _diff_builtin: (),
#[spirv(descriptor_set = 0, descriptor_set = 0)] _same_descriptor_set: (),
#[spirv(descriptor_set = 0, descriptor_set = 1)] _diff_descriptor_set: (),
#[spirv(binding = 0, binding = 0)] _same_binding: (),
#[spirv(binding = 0, binding = 1)] _diff_binding: (),
#[spirv(flat, flat)] _flat: (),
#[spirv(invariant, invariant)] _invariant: (),
) {
}
#[spirv(unroll_loops, unroll_loops)]
fn _unroll_loops() {}