Files
wgpu/tests/out/spv/pointers.spvasm
T
Jim Blandy 8122598fe7 [wgsl-out] Correct handling of named pointer expressions.
Treat expressions in `Function::named_expressions` like WGSL `let` declarations,
assuming that the Load Rule was applied to the rhs of the declaration, meaning
that their values are always `Indirection::Ordinary`.

Split `write_expr_plain_form` out from `write_expr_with_indirection`, to clean
up the parenthesis generation: no more `opened_paren` variable, just function
calls. This makes the early return for named expressions neater.

Fixes #1382.
2021-09-27 16:01:43 -04:00

29 lines
595 B
Plaintext

; SPIR-V
; Version: 1.2
; Generator: rspirv
; Bound: 16
OpCapability Shader
OpCapability Linkage
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpSource GLSL 450
OpName %6 "v"
OpName %9 "f"
%2 = OpTypeVoid
%4 = OpTypeInt 32 1
%3 = OpConstant %4 10
%5 = OpTypeVector %4 2
%7 = OpTypePointer Function %5
%10 = OpTypeFunction %2
%12 = OpTypePointer Function %4
%14 = OpTypeInt 32 0
%13 = OpConstant %14 0
%9 = OpFunction %2 None %10
%8 = OpLabel
%6 = OpVariable %7 Function
OpBranch %11
%11 = OpLabel
%15 = OpAccessChain %12 %6 %13
OpStore %15 %3
OpReturn
OpFunctionEnd