tint/writer/spirv: Inline constant expressions

This is required to handle materialized values, and for constant
expressions.

Bug: tint:1504
Change-Id: If0a49e9b03566c06aa6e4e4c284fc427e1541e91
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92082
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
Ben Clayton
2022-06-01 15:57:22 +00:00
committed by Dawn LUCI CQ
parent 609ce6de8d
commit 8e3485248e
242 changed files with 10432 additions and 10031 deletions

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 15
; Bound: 14
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -16,15 +16,14 @@
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
%9 = OpConstantNull %float
%float_0 = OpConstant %float 0
%f = OpFunction %void None %1
%4 = OpLabel
%a = OpVariable %_ptr_Function_float Function %9
%b = OpVariable %_ptr_Function_float Function %9
OpStore %a %float_1
OpStore %b %float_0
%12 = OpLoad %float %a
%13 = OpLoad %float %b
%14 = OpFRem %float %12 %13
OpStore %b %9
%11 = OpLoad %float %a
%12 = OpLoad %float %b
%13 = OpFRem %float %11 %12
OpReturn
OpFunctionEnd

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 15
; Bound: 14
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -16,15 +16,14 @@
%int_1 = OpConstant %int 1
%_ptr_Function_int = OpTypePointer Function %int
%9 = OpConstantNull %int
%int_0 = OpConstant %int 0
%f = OpFunction %void None %1
%4 = OpLabel
%a = OpVariable %_ptr_Function_int Function %9
%b = OpVariable %_ptr_Function_int Function %9
OpStore %a %int_1
OpStore %b %int_0
%12 = OpLoad %int %a
%13 = OpLoad %int %b
%14 = OpSMod %int %12 %13
OpStore %b %9
%11 = OpLoad %int %a
%12 = OpLoad %int %b
%13 = OpSMod %int %11 %12
OpReturn
OpFunctionEnd

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 15
; Bound: 14
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -16,15 +16,14 @@
%uint_1 = OpConstant %uint 1
%_ptr_Function_uint = OpTypePointer Function %uint
%9 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%f = OpFunction %void None %1
%4 = OpLabel
%a = OpVariable %_ptr_Function_uint Function %9
%b = OpVariable %_ptr_Function_uint Function %9
OpStore %a %uint_1
OpStore %b %uint_0
%12 = OpLoad %uint %a
%13 = OpLoad %uint %b
%14 = OpUMod %uint %12 %13
OpStore %b %9
%11 = OpLoad %uint %a
%12 = OpLoad %uint %b
%13 = OpUMod %uint %11 %12
OpReturn
OpFunctionEnd

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 23
; Bound: 22
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -20,19 +20,18 @@
%10 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%_ptr_Function_v3int = OpTypePointer Function %v3int
%13 = OpConstantNull %v3int
%int_0 = OpConstant %int 0
%14 = OpConstantNull %int
%_ptr_Function_int = OpTypePointer Function %int
%17 = OpConstantNull %int
%f = OpFunction %void None %1
%4 = OpLabel
%a = OpVariable %_ptr_Function_v3int Function %13
%b = OpVariable %_ptr_Function_int Function %17
%21 = OpVariable %_ptr_Function_v3int Function %13
%b = OpVariable %_ptr_Function_int Function %14
%20 = OpVariable %_ptr_Function_v3int Function %13
OpStore %a %10
OpStore %b %int_0
%18 = OpLoad %v3int %a
%19 = OpLoad %int %b
%22 = OpCompositeConstruct %v3int %19 %19 %19
%20 = OpSMod %v3int %18 %22
OpStore %b %14
%17 = OpLoad %v3int %a
%18 = OpLoad %int %b
%21 = OpCompositeConstruct %v3int %18 %18 %18
%19 = OpSMod %v3int %17 %21
OpReturn
OpFunctionEnd

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 23
; Bound: 22
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -20,19 +20,18 @@
%10 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
%13 = OpConstantNull %v3uint
%uint_0 = OpConstant %uint 0
%14 = OpConstantNull %uint
%_ptr_Function_uint = OpTypePointer Function %uint
%17 = OpConstantNull %uint
%f = OpFunction %void None %1
%4 = OpLabel
%a = OpVariable %_ptr_Function_v3uint Function %13
%b = OpVariable %_ptr_Function_uint Function %17
%21 = OpVariable %_ptr_Function_v3uint Function %13
%b = OpVariable %_ptr_Function_uint Function %14
%20 = OpVariable %_ptr_Function_v3uint Function %13
OpStore %a %10
OpStore %b %uint_0
%18 = OpLoad %v3uint %a
%19 = OpLoad %uint %b
%22 = OpCompositeConstruct %v3uint %19 %19 %19
%20 = OpUMod %v3uint %18 %22
OpStore %b %14
%17 = OpLoad %v3uint %a
%18 = OpLoad %uint %b
%21 = OpCompositeConstruct %v3uint %18 %18 %18
%19 = OpUMod %v3uint %17 %21
OpReturn
OpFunctionEnd