Skip to content

Commit

Permalink
ByteAddressableBuffer: fixup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Firestar99 committed Sep 27, 2024
1 parent 40351e4 commit f78287a
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
20 changes: 10 additions & 10 deletions tests/ui/arch/debug_printf_type_checking.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ help: the return type of this call is `u32` due to the type of the argument pass
| |
| this argument influences the return type of `spirv_std`
note: function defined here
--> $SPIRV_STD_SRC/lib.rs:138:8
--> $SPIRV_STD_SRC/lib.rs:141:8
|
138 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
141 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
help: change the type of the numeric literal from `u32` to `f32`
Expand All @@ -102,9 +102,9 @@ help: the return type of this call is `f32` due to the type of the argument pass
| |
| this argument influences the return type of `spirv_std`
note: function defined here
--> $SPIRV_STD_SRC/lib.rs:138:8
--> $SPIRV_STD_SRC/lib.rs:141:8
|
138 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
141 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
help: change the type of the numeric literal from `f32` to `u32`
Expand All @@ -129,12 +129,12 @@ error[E0277]: the trait bound `{float}: Vector<f32, 2>` is not satisfied
<UVec3 as Vector<u32, 3>>
and 5 others
note: required by a bound in `debug_printf_assert_is_vector`
--> $SPIRV_STD_SRC/lib.rs:145:8
--> $SPIRV_STD_SRC/lib.rs:148:8
|
143 | pub fn debug_printf_assert_is_vector<
146 | pub fn debug_printf_assert_is_vector<
| ----------------------------- required by a bound in this function
144 | TY: crate::scalar::Scalar,
145 | V: crate::vector::Vector<TY, SIZE>,
147 | TY: crate::scalar::Scalar,
148 | V: crate::vector::Vector<TY, SIZE>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `debug_printf_assert_is_vector`
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand All @@ -155,9 +155,9 @@ help: the return type of this call is `Vec2` due to the type of the argument pas
| |
| this argument influences the return type of `spirv_std`
note: function defined here
--> $SPIRV_STD_SRC/lib.rs:138:8
--> $SPIRV_STD_SRC/lib.rs:141:8
|
138 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
141 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand Down
4 changes: 2 additions & 2 deletions tests/ui/byte_addressable_buffer/arr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// build-pass

use spirv_std::spirv;
use spirv_std::{glam::Vec4, ByteAddressableBuffer};
use spirv_std::{glam::Vec4, ByteAddressableBuffer, MutByteAddressableBuffer};

#[spirv(fragment)]
pub fn load(
Expand All @@ -20,7 +20,7 @@ pub fn store(
#[spirv(flat)] val: [i32; 4],
) {
unsafe {
let mut buf = ByteAddressableBuffer::new(buf);
let mut buf = MutByteAddressableBuffer::new(buf);
buf.store(5, val);
}
}
4 changes: 2 additions & 2 deletions tests/ui/byte_addressable_buffer/big_struct.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// build-pass

use spirv_std::spirv;
use spirv_std::ByteAddressableBuffer;
use spirv_std::{ByteAddressableBuffer, MutByteAddressableBuffer};

pub struct BigStruct {
a: u32,
Expand Down Expand Up @@ -29,7 +29,7 @@ pub fn store(
#[spirv(flat)] val: BigStruct,
) {
unsafe {
let mut buf = ByteAddressableBuffer::new(buf);
let mut buf = MutByteAddressableBuffer::new(buf);
buf.store(5, val);
}
}
4 changes: 2 additions & 2 deletions tests/ui/byte_addressable_buffer/complex.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// build-pass

use spirv_std::spirv;
use spirv_std::{glam::Vec2, ByteAddressableBuffer};
use spirv_std::{glam::Vec2, ByteAddressableBuffer, MutByteAddressableBuffer};

pub struct Complex {
x: u32,
Expand Down Expand Up @@ -35,7 +35,7 @@ pub fn store(
val: Nesty,
) {
unsafe {
let mut buf = ByteAddressableBuffer::new(buf);
let mut buf = MutByteAddressableBuffer::new(buf);
buf.store(5, val);
}
}
4 changes: 2 additions & 2 deletions tests/ui/byte_addressable_buffer/empty_struct.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// build-pass

use spirv_std::spirv;
use spirv_std::ByteAddressableBuffer;
use spirv_std::{ByteAddressableBuffer, MutByteAddressableBuffer};

pub struct EmptyStruct {}

Expand All @@ -20,7 +20,7 @@ pub fn load(
pub fn store(#[spirv(descriptor_set = 0, binding = 0, storage_buffer)] buf: &mut [u32]) {
let val = EmptyStruct {};
unsafe {
let mut buf = ByteAddressableBuffer::new(buf);
let mut buf = MutByteAddressableBuffer::new(buf);
buf.store(5, val);
}
}
4 changes: 2 additions & 2 deletions tests/ui/byte_addressable_buffer/f32.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// build-pass

use spirv_std::spirv;
use spirv_std::ByteAddressableBuffer;
use spirv_std::{ByteAddressableBuffer, MutByteAddressableBuffer};

#[spirv(fragment)]
pub fn load(
Expand All @@ -17,7 +17,7 @@ pub fn load(
#[spirv(fragment)]
pub fn store(#[spirv(descriptor_set = 0, binding = 0, storage_buffer)] buf: &mut [u32], val: f32) {
unsafe {
let mut buf = ByteAddressableBuffer::new(buf);
let mut buf = MutByteAddressableBuffer::new(buf);
buf.store(5, val);
}
}
4 changes: 2 additions & 2 deletions tests/ui/byte_addressable_buffer/small_struct.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// build-pass

use spirv_std::spirv;
use spirv_std::ByteAddressableBuffer;
use spirv_std::{ByteAddressableBuffer, MutByteAddressableBuffer};

pub struct SmallStruct {
a: u32,
Expand All @@ -27,7 +27,7 @@ pub fn store(
) {
let val = SmallStruct { a, b };
unsafe {
let mut buf = ByteAddressableBuffer::new(buf);
let mut buf = MutByteAddressableBuffer::new(buf);
buf.store(5, val);
}
}
4 changes: 2 additions & 2 deletions tests/ui/byte_addressable_buffer/u32.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// build-pass

use spirv_std::spirv;
use spirv_std::ByteAddressableBuffer;
use spirv_std::{ByteAddressableBuffer, MutByteAddressableBuffer};

#[spirv(fragment)]
pub fn load(
Expand All @@ -20,7 +20,7 @@ pub fn store(
#[spirv(flat)] val: u32,
) {
unsafe {
let mut buf = ByteAddressableBuffer::new(buf);
let mut buf = MutByteAddressableBuffer::new(buf);
buf.store(5, val);
}
}
4 changes: 2 additions & 2 deletions tests/ui/byte_addressable_buffer/vec.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// build-pass

use spirv_std::spirv;
use spirv_std::{glam::Vec4, ByteAddressableBuffer};
use spirv_std::{glam::Vec4, ByteAddressableBuffer, MutByteAddressableBuffer};

#[spirv(matrix)]
pub struct Mat4 {
Expand Down Expand Up @@ -31,7 +31,7 @@ pub fn store(
valmat: Mat4,
) {
unsafe {
let mut buf = ByteAddressableBuffer::new(buf);
let mut buf = MutByteAddressableBuffer::new(buf);
buf.store(5, val);
buf.store(5, valmat);
}
Expand Down

0 comments on commit f78287a

Please sign in to comment.