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

@@ -33,7 +33,7 @@
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%20 = OpConstantNull %int
%_ptr_Function_float = OpTypePointer Function %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %5
@@ -41,7 +41,7 @@
%m1 = OpVariable %_ptr_Function_mat2v4float Function %14
%17 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%18 = OpLoad %uint %17
%22 = OpAccessChain %_ptr_Function_float %m1 %18 %int_0
%22 = OpAccessChain %_ptr_Function_float %m1 %18 %20
OpStore %22 %float_1
OpReturn
OpFunctionEnd

View File

@@ -32,7 +32,7 @@
%void = OpTypeVoid
%11 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%16 = OpConstantNull %int
%uint_1 = OpConstant %uint 1
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_Private_float = OpTypePointer Private %float
@@ -41,7 +41,7 @@
%14 = OpLabel
%19 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%20 = OpLoad %uint %19
%22 = OpAccessChain %_ptr_Private_float %m1 %int_0 %20
%22 = OpAccessChain %_ptr_Private_float %m1 %16 %20
OpStore %22 %float_1
OpReturn
OpFunctionEnd

View File

@@ -34,14 +34,14 @@
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%20 = OpConstantNull %int
%_ptr_Private_float = OpTypePointer Private %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %11
%14 = OpLabel
%17 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
%18 = OpLoad %uint %17
%22 = OpAccessChain %_ptr_Private_float %m1 %18 %int_0
%22 = OpAccessChain %_ptr_Private_float %m1 %18 %20
OpStore %22 %float_1
OpReturn
OpFunctionEnd

View File

@@ -32,7 +32,7 @@
%void = OpTypeVoid
%11 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%16 = OpConstantNull %int
%uint_1 = OpConstant %uint 1
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%_ptr_Private_float = OpTypePointer Private %float
@@ -41,7 +41,7 @@
%14 = OpLabel
%19 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
%20 = OpLoad %uint %19
%22 = OpAccessChain %_ptr_Private_float %m1 %int_0 %20
%22 = OpAccessChain %_ptr_Private_float %m1 %16 %20
OpStore %22 %float_1
OpReturn
OpFunctionEnd