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

@@ -12,9 +12,9 @@
%1 = OpTypeFunction %void
%float = OpTypeFloat 32
%float_1 = OpConstant %float 1
%float_0 = OpConstant %float 0
%7 = OpConstantNull %float
%f = OpFunction %void None %1
%4 = OpLabel
%8 = OpFRem %float %float_1 %float_0
%8 = OpFRem %float %float_1 %7
OpReturn
OpFunctionEnd

View File

@@ -12,9 +12,9 @@
%1 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%int_0 = OpConstant %int 0
%7 = OpConstantNull %int
%f = OpFunction %void None %1
%4 = OpLabel
%8 = OpSMod %int %int_1 %int_0
%8 = OpSMod %int %int_1 %7
OpReturn
OpFunctionEnd

View File

@@ -12,9 +12,9 @@
%1 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%uint_0 = OpConstant %uint 0
%7 = OpConstantNull %uint
%f = OpFunction %void None %1
%4 = OpLabel
%8 = OpUMod %uint %uint_1 %uint_0
%8 = OpUMod %uint %uint_1 %7
OpReturn
OpFunctionEnd

View File

@@ -16,13 +16,13 @@
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%10 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%int_0 = OpConstant %int 0
%11 = OpConstantNull %int
%_ptr_Function_v3int = OpTypePointer Function %v3int
%15 = OpConstantNull %v3int
%f = OpFunction %void None %1
%4 = OpLabel
%13 = OpVariable %_ptr_Function_v3int Function %15
%16 = OpCompositeConstruct %v3int %int_0 %int_0 %int_0
%16 = OpCompositeConstruct %v3int %11 %11 %11
%12 = OpSMod %v3int %10 %16
OpReturn
OpFunctionEnd

View File

@@ -16,13 +16,13 @@
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%10 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%uint_0 = OpConstant %uint 0
%11 = OpConstantNull %uint
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
%15 = OpConstantNull %v3uint
%f = OpFunction %void None %1
%4 = OpLabel
%13 = OpVariable %_ptr_Function_v3uint Function %15
%16 = OpCompositeConstruct %v3uint %uint_0 %uint_0 %uint_0
%16 = OpCompositeConstruct %v3uint %11 %11 %11
%12 = OpUMod %v3uint %10 %16
OpReturn
OpFunctionEnd