dawn-cmake/test/bug/tint/992.wgsl.expected.spvasm
Ben Clayton 595b0547d4 writer[spirv,hlsl]: Call UnwrapRef() for splats
The TypeConstructorExpression logic that tested for splats was not considering references. This led to broken emission for the SPIR-V and HLSL backends.

Fixed: tint:992
Change-Id: I9824b71f526997f91d380c09b459f4fd73065b19
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/58397
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
2021-07-18 15:41:25 +00:00

54 lines
2.1 KiB
Plaintext

; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 31
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %frag_main "frag_main" %tint_symbol_1
OpExecutionMode %frag_main OriginUpperLeft
OpName %tint_symbol_1 "tint_symbol_1"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %tint_symbol "tint_symbol"
OpName %frag_main "frag_main"
OpName %b "b"
OpName %v "v"
OpDecorate %tint_symbol_1 Location 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %5
%void = OpTypeVoid
%6 = OpTypeFunction %void %v4float
%11 = OpTypeFunction %void
%float_0 = OpConstant %float 0
%_ptr_Function_float = OpTypePointer Function %float
%17 = OpConstantNull %float
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%23 = OpConstantNull %v3float
%float_1 = OpConstant %float 1
%tint_symbol_2 = OpFunction %void None %6
%tint_symbol = OpFunctionParameter %v4float
%10 = OpLabel
OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
%frag_main = OpFunction %void None %11
%13 = OpLabel
%b = OpVariable %_ptr_Function_float Function %17
%v = OpVariable %_ptr_Function_v3float Function %23
OpStore %b %float_0
%19 = OpLoad %float %b
%20 = OpCompositeConstruct %v3float %19 %19 %19
OpStore %v %20
%25 = OpLoad %v3float %v
%26 = OpCompositeExtract %float %25 0
%27 = OpCompositeExtract %float %25 1
%28 = OpCompositeExtract %float %25 2
%30 = OpCompositeConstruct %v4float %26 %27 %28 %float_1
%24 = OpFunctionCall %void %tint_symbol_2 %30
OpReturn
OpFunctionEnd