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

ICE: uniform constant inference panics #585

Closed
msiglreith opened this issue Apr 8, 2021 · 0 comments · Fixed by #594
Closed

ICE: uniform constant inference panics #585

msiglreith opened this issue Apr 8, 2021 · 0 comments · Fixed by #594
Assignees
Labels
a: inference Issues around inferring types in SPIR-V asm. c: rustc_codegen_spirv Issues specific to the rustc_codegen_spirv crate. t: bug Something isn't working

Comments

@msiglreith
Copy link
Contributor

Opaque types are partially inferred as Input instead of UniformConstants when passing by value resulting in an internal ICE (see Case 2).

Case 1: passing by value w/o inference

#[spirv(uniform_constant, descriptor_set = 0, binding = 1)] u_diffuse_map: Cubemap,

Result: nice!

  error: invalid entry param type `spirv_std::Cubemap` for storage class `UniformConstant` (expected `&T`)
    --> glace-vk\shader\src\lib.rs:68:80
     |
  68 |     #[spirv(uniform_constant, descriptor_set = 0, binding = 1)] u_diffuse_map: Cubemap,
     |  

Case 2: passing by value w/ inference

#[spirv(descriptor_set = 0, binding = 1)] u_diffuse_map: Cubemap,

Result: ICE

  thread 'rustc' panicked at 'assertion failed: `(left == right)`
    left: `UniformConstant`,
   right: `Input`', E:\Rust\git\checkouts\rust-gpu-e0a37a82a46176e6\8c89b49\crates\rustc_codegen_spirv\src\codegen_cx\entry.rs:342:13

Case 3: passing by ref w/ inference

#[spirv(descriptor_set = 0, binding = 1)] u_diffuse_map: &Cubemap,

Result: works fine

@msiglreith msiglreith added the t: bug Something isn't working label Apr 8, 2021
@XAMPPRocky XAMPPRocky added a: inference Issues around inferring types in SPIR-V asm. c: rustc_codegen_spirv Issues specific to the rustc_codegen_spirv crate. labels Apr 9, 2021
@khyperia khyperia self-assigned this Apr 13, 2021
@khyperia khyperia mentioned this issue Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: inference Issues around inferring types in SPIR-V asm. c: rustc_codegen_spirv Issues specific to the rustc_codegen_spirv crate. t: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants