mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 16:37:08 +00:00
spirv-reader: switch to HLSL-style pipeline IO
- When storing to sample_mask output, write to the 0th element - Only make a return struct if it has members - Adjust type signedness coercion when loading special builtins. - Adapt tests - Update expectations for end-to-end tests - Handle sample_mask with stride Input variables normally don't have layout. But they can have it up through SPIR-V 1.4. Handle this case in the SPIR-V reader, by seeing through the intermediate alias type created for the strided array type. Bug: tint:508 Change-Id: I0f19dc1305d3f250dbbc0698a602288c34245274 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54743 Auto-Submit: David Neto <dneto@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -3,10 +3,15 @@ void func(int value, inout int pointer) {
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
void main_1() {
|
||||
int i = 0;
|
||||
i = 123;
|
||||
func(123, i);
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
main_1();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,15 @@ void func(int value, thread int* const pointer) {
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void tint_symbol() {
|
||||
void main_1() {
|
||||
int i = 0;
|
||||
i = 123;
|
||||
func(123, &(i));
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void tint_symbol() {
|
||||
main_1();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 19
|
||||
; Bound: 22
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
@@ -10,8 +10,9 @@
|
||||
OpName %func "func"
|
||||
OpName %value "value"
|
||||
OpName %pointer "pointer"
|
||||
OpName %main "main"
|
||||
OpName %main_1 "main_1"
|
||||
OpName %i "i"
|
||||
OpName %main "main"
|
||||
%void = OpTypeVoid
|
||||
%int = OpTypeInt 32 1
|
||||
%_ptr_Function_int = OpTypePointer Function %int
|
||||
@@ -27,7 +28,7 @@
|
||||
OpStore %pointer %value
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %10
|
||||
%main_1 = OpFunction %void None %10
|
||||
%12 = OpLabel
|
||||
%i = OpVariable %_ptr_Function_int Function %15
|
||||
OpStore %i %int_0
|
||||
@@ -35,3 +36,8 @@
|
||||
%17 = OpFunctionCall %void %func %int_123 %i
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%main = OpFunction %void None %10
|
||||
%20 = OpLabel
|
||||
%21 = OpFunctionCall %void %main_1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -3,10 +3,14 @@ fn func(value : i32, pointer : ptr<function, i32>) {
|
||||
return;
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn main() {
|
||||
fn main_1() {
|
||||
var i : i32 = 0;
|
||||
i = 123;
|
||||
func(123, &(i));
|
||||
return;
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn main() {
|
||||
main_1();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user