Files
wgpu/naga/tests/out/spv/7048-multiple-dynamic-2.spvasm
T
Jim Blandy a285ad13f0 [naga spv-out] Don't generate multiple temporaries for spill values. (#7239)
When spilling arrays and matrices so that we can access them with an
index computed at runtime, if we need to spill the same expression again,
don't wipe out our record of the temporary variable we used the first
time. Just re-use it.

Fixes #7048.
2025-02-27 18:34:52 +01:00

48 lines
1.2 KiB
Plaintext

; SPIR-V
; Version: 1.1
; Generator: rspirv
; Bound: 33
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %13 "fs_main" %11
OpExecutionMode %13 OriginUpperLeft
OpDecorate %6 ArrayStride 8
OpDecorate %11 Location 0
%2 = OpTypeVoid
%4 = OpTypeFloat 32
%3 = OpTypeVector %4 4
%5 = OpTypeVector %4 2
%8 = OpTypeInt 32 0
%7 = OpConstant %8 2
%6 = OpTypeArray %5 %7
%9 = OpTypeInt 32 1
%12 = OpTypePointer Output %3
%11 = OpVariable %12 Output
%14 = OpTypeFunction %2
%15 = OpConstant %4 0.0
%16 = OpConstantComposite %5 %15 %15
%17 = OpConstantComposite %6 %16 %16
%18 = OpConstant %9 0
%20 = OpTypePointer Function %9
%23 = OpTypePointer Function %6
%25 = OpTypePointer Function %5
%13 = OpFunction %2 None %14
%10 = OpLabel
%19 = OpVariable %20 Function %18
%24 = OpVariable %23 Function
OpBranch %21
%21 = OpLabel
%22 = OpLoad %9 %19
OpStore %24 %17
%26 = OpAccessChain %25 %24 %22
%27 = OpLoad %5 %26
%28 = OpLoad %9 %19
OpStore %24 %17
%29 = OpAccessChain %25 %24 %28
%30 = OpLoad %5 %29
%31 = OpFMul %5 %27 %30
%32 = OpVectorShuffle %3 %31 %31 0 0 1 1
OpStore %11 %32
OpReturn
OpFunctionEnd