-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: adjust for lack of
PassMode::{Indirect, Cast}
.
- Loading branch information
Showing
6 changed files
with
71 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// This is a similar setup to the `issue-731` test, but instead of "just" the | ||
// missing copy out of the global (`Input`) `OpVariable`, small enough types | ||
// would fail much earlier, as they would use `PassMode::Cast`, through the | ||
// default Rust ABI adjustments (that we now override through query hooks). | ||
|
||
// build-pass | ||
// compile-flags: -C llvm-args=--disassemble-entry=main | ||
|
||
use spirv_std as _; | ||
|
||
#[spirv(fragment)] | ||
pub fn main(mut in_array: [f32; 2], out_array: &mut [f32; 2]) { | ||
in_array[0] += 1.0; | ||
*out_array = in_array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
%1 = OpFunction %2 None %3 | ||
%4 = OpLabel | ||
%5 = OpVariable %6 Function | ||
%7 = OpVariable %6 Function | ||
OpLine %8 12 12 | ||
%9 = OpLoad %10 %11 | ||
OpLine %8 12 0 | ||
OpStore %5 %9 | ||
OpLine %8 13 4 | ||
%12 = OpInBoundsAccessChain %13 %5 %14 | ||
%15 = OpInBoundsAccessChain %13 %5 %14 | ||
%16 = OpLoad %17 %15 | ||
%18 = OpFAdd %17 %16 %19 | ||
OpStore %12 %18 | ||
OpLine %8 14 17 | ||
OpCopyMemory %7 %5 | ||
OpLine %8 14 4 | ||
OpCopyMemory %20 %7 | ||
OpLine %8 15 1 | ||
OpReturn | ||
OpFunctionEnd |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Test that non-immediate (i.e. not one of scalar/scalar-pair/vector) inputs | ||
// get properly copied out of the global (`Input`) `OpVariable` and mutation is | ||
// only ever done on `fn`-local `OpVariable`s, not on the original global. | ||
|
||
// build-pass | ||
// compile-flags: -C llvm-args=--disassemble-entry=main | ||
|
||
use spirv_std as _; | ||
|
||
#[spirv(fragment)] | ||
pub fn main(mut in_array: [f32; 3], out_array: &mut [f32; 3]) { | ||
in_array[0] += 1.0; | ||
*out_array = in_array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
%1 = OpFunction %2 None %3 | ||
%4 = OpLabel | ||
%5 = OpVariable %6 Function | ||
%7 = OpVariable %6 Function | ||
OpLine %8 11 12 | ||
%9 = OpLoad %10 %11 | ||
OpLine %8 11 0 | ||
OpStore %5 %9 | ||
OpLine %8 12 4 | ||
%12 = OpInBoundsAccessChain %13 %5 %14 | ||
%15 = OpInBoundsAccessChain %13 %5 %14 | ||
%16 = OpLoad %17 %15 | ||
%18 = OpFAdd %17 %16 %19 | ||
OpStore %12 %18 | ||
OpLine %8 13 17 | ||
OpCopyMemory %7 %5 | ||
OpLine %8 13 4 | ||
OpCopyMemory %20 %7 | ||
OpLine %8 14 1 | ||
OpReturn | ||
OpFunctionEnd |