We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Initializing arrays seems to replace 0i32 with 0u32 when using [0i32; N].
Example (see https://github.com/charles-r-earp/rust-gpu/tree/array-init for compiletests).
; SPIR-V ; Version: 1.3 ; Generator: Google rspirv; 0 ; Bound: 11 ; Schema: 0 OpCapability Shader OpCapability Float64 OpCapability Int64 OpCapability Int16 OpCapability Int8 OpCapability ShaderClockKHR OpExtension "SPV_KHR_shader_clock" OpMemoryModel Logical Simple OpEntryPoint Fragment %1 "main" %o OpExecutionMode %1 OriginUpperLeft %3 = OpString "/home/charles/Documents/rust/rust-gpu/tests/ui/lang/core/array/init_array_i32.rs" OpSource Unknown 0 %3 "// Test creating an array. // build-pass use spirv_std::macros::spirv; #[spirv(fragment)] pub fn main(o: &mut i32) { let array = [0i32; 4]; *o = array[0]; } " OpName %o "o" OpDecorate %o Location 0 %int = OpTypeInt 32 1 %_ptr_Output_int = OpTypePointer Output %int %void = OpTypeVoid %7 = OpTypeFunction %void %o = OpVariable %_ptr_Output_int Output %uint = OpTypeInt 32 0 %uint_0 = OpConstant %uint 0 %1 = OpFunction %void None %7 %10 = OpLabel OpLine %3 9 4 OpStore %o %uint_0 OpNoLine OpReturn OpFunctionEnd
A 0u32 is stored to o instead of the expected 0i32, which fails to compile.
o
What works:
<[T; N]>::default()
[0i32, 0i32, ..]
[1i32; 1]
The text was updated successfully, but these errors were encountered:
Account for signedness in memset const pat
231ca17
Fixes EmbarkStudios#1061 Thanks to LegNeato
Successfully merging a pull request may close this issue.
Initializing arrays seems to replace 0i32 with 0u32 when using [0i32; N].
Example (see https://github.com/charles-r-earp/rust-gpu/tree/array-init for compiletests).
A 0u32 is stored to
o
instead of the expected 0i32, which fails to compile.What works:
<[T; N]>::default()
[0i32, 0i32, ..]
[1i32; 1]
The text was updated successfully, but these errors were encountered: