tint: make const eval of binary ops on concrete values fail on NaN/Inf

With this CL, binary ops add, subtract, multiply, and divide of concrete
values will now produce an error if the result is inf/NaN, as it was
doing with abstract values. This also affects the cross builtin, which
is written in terms of subtract and multiply.

Bug: tint:1581
Bug: tint:1747
Change-Id: Ib1d0d8deddc82c67ab53729a6011937636fcc1a5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110163
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Antonio Maiorano
2022-11-18 05:45:17 +00:00
parent e956a04daf
commit 0da91e06c5
13 changed files with 145 additions and 165 deletions

View File

@@ -146,7 +146,7 @@ OpDecorate %20 Binding 1
%128 = OpLoad %50 %10
%129 = OpLoad %52 %20
%130 = OpSampledImage %124 %129 %128
%131 = OpImageSampleProjImplicitLod %v4float %130 %126
%131 = OpImageSampleProjImplicitLod %v4float %130 %47
OpReturn
OpFunctionEnd

View File

@@ -146,7 +146,7 @@ OpDecorate %20 Binding 1
%128 = OpLoad %50 %10
%129 = OpLoad %52 %20
%130 = OpSampledImage %124 %129 %128
%131 = OpImageSampleProjExplicitLod %v4float %130 %126 Lod %29
%131 = OpImageSampleProjExplicitLod %v4float %130 %47 Lod %29
OpReturn
OpFunctionEnd

View File

@@ -146,7 +146,7 @@ OpDecorate %20 Binding 1
%128 = OpLoad %50 %10
%129 = OpLoad %52 %20
%130 = OpSampledImage %124 %129 %128
%131 = OpImageSampleProjDrefImplicitLod %float %130 %126 %float_0_200000003
%131 = OpImageSampleProjDrefImplicitLod %float %130 %47 %float_0_200000003
OpReturn
OpFunctionEnd

View File

@@ -146,7 +146,7 @@ OpDecorate %20 Binding 1
%128 = OpLoad %50 %10
%129 = OpLoad %52 %20
%130 = OpSampledImage %124 %129 %128
%131 = OpImageSampleProjDrefExplicitLod %float %130 %126 %float_0_200000003 Lod %29
%131 = OpImageSampleProjDrefExplicitLod %float %130 %47 %float_0_200000003 Lod %29
OpReturn
OpFunctionEnd