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

add test cases for TypedBuffer #1

Open
wants to merge 2 commits into
base: buffer-interface-block
Choose a base branch
from

Conversation

SiebenCorgie
Copy link

@SiebenCorgie SiebenCorgie commented Jul 17, 2024

Adds 3 test cases for the TypedBuffer interface. Currently typed-buffer-unbound & typed-buffer-unbound-struct are broken with:

error: cannot cast between pointer types
test [ui] ui/storage_class/typed-buffer-unbound.rs ... FAILED
normalized stderr:
error: cannot cast between pointer types
       from `*struct core::mem::MaybeUninit<&mut [MyData]> { uninit: *[struct MyData { a: f32, b: [u32; 3] }], value: u32 }`
         to `*struct &mut [MyData] { *[struct MyData { a: f32, b: [u32; 3] }], u32 }`
   --> /home/myname/.rustup/toolchains/nightly-2023-09-30-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/maybe_uninit.rs:570:6
    |
570 |     }
    |      ^
    |
note: used from within `>::as_mut_ptr`
   --> /home/myname.rustup/toolchains/nightly-2023-09-30-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/maybe_uninit.rs:570:6
    |
570 |     }
    |      ^
note: called by ` as core::ops::deref::Deref>::deref`
   --> /home/myname/Code/Rust/git_pulls/rust-gpu/crates/spirv-std/src/typed_buffer.rs:75:39
    |
75  |                 result_slot = in(reg) result_slot.as_mut_ptr(),
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^
note: called by `typed_buffer_unbound_struct::compute`
   --> $DIR/typed-buffer-unbound-struct.rs:18:32
    |
18  |     let mut load_dta: MyData = unsafe { my_data.index(global_invocation_id.x as usize) }[0];
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: called by `compute`
   --> $DIR/typed-buffer-unbound-struct.rs:12:8
    |
12  | pub fn compute(
    |        ^^^^^^^

error: cannot cast between pointer types
       from `*struct core::mem::MaybeUninit<&mut [MyData]> { uninit: *[struct MyData { a: f32, b: [u32; 3] }], value: u32 }`
         to `*struct &mut [MyData] { *[struct MyData { a: f32, b: [u32; 3] }], u32 }`
   --> /home/myname.rustup/toolchains/nightly-2023-09-30-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/maybe_uninit.rs:570:6
    |
570 |     }
    |      ^
    |
note: used from within `>::as_mut_ptr`
   --> /home/myname/.rustup/toolchains/nightly-2023-09-30-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/maybe_uninit.rs:570:6
    |
570 |     }
    |      ^
note: called by ` as core::ops::deref::DerefMut>::deref_mut`
   --> /home/myname/Code/Rust/git_pulls/rust-gpu/crates/spirv-std/src/typed_buffer.rs:95:39
    |
95  |                 result_slot = in(reg) result_slot.as_mut_ptr(),
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^
note: called by `typed_buffer_unbound_struct::compute`
   --> $DIR/typed-buffer-unbound-struct.rs:21:36
    |
21  |     let mut target = unsafe { &mut my_data.index_mut(global_invocation_id.y as usize)[0] };
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: called by `compute`
   --> $DIR/typed-buffer-unbound-struct.rs:12:8
    |
12  | pub fn compute(
    |        ^^^^^^^

error: aborting due to 2 previous errors

@SiebenCorgie SiebenCorgie requested a review from eddyb as a code owner July 17, 2024 11:09
eddyb pushed a commit that referenced this pull request Aug 2, 2024
* Change URLs
* Switch away from paid runners.
* Drop copyright from MIT license. Similar to the Rust project. See the git history of
https://github.com/rust-lang/rust/blob/master/LICENSE-MIT
@eddyb eddyb force-pushed the buffer-interface-block branch 6 times, most recently from 8ee360c to 9d6b34f Compare August 9, 2024 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants