SPIRV-Cross/shaders-msl-no-opt/asm/packing/load-packed-no-forwarding-5.asm.comp
Hans-Kristian Arntzen 18bcc9b790 Do not disable temporary forwarding when we suppress usage tracking.
This subtle bug removed any expression validation for trivially swizzled
variables. Make usage suppression a more explicit concept rather than
just hacking off forwarded_temporaries.

There is some fallout here with loop generation since our expression
invalidation is currently a bit too naive to handle loops properly.
The forwarding bug masked this problem until now.

If part of the loop condition is also used in the body, we end up
reading an invalid expression, which in turn forces a temporary to be
generated in the condition block, not good. We'll need to be smarter
here ...
2019-07-23 19:18:44 +02:00

55 lines
2.2 KiB
Plaintext

; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 7
; Bound: 29
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpSource GLSL 450
OpSourceExtension "GL_EXT_scalar_block_layout"
OpName %main "main"
OpName %SSBOScalar "SSBOScalar"
OpMemberName %SSBOScalar 0 "a"
OpMemberName %SSBOScalar 1 "b"
OpMemberName %SSBOScalar 2 "c"
OpName %_ ""
OpMemberDecorate %SSBOScalar 0 Offset 0
OpMemberDecorate %SSBOScalar 1 Offset 8
OpMemberDecorate %SSBOScalar 2 Offset 20
OpDecorate %SSBOScalar BufferBlock
OpDecorate %_ DescriptorSet 0
OpDecorate %_ Binding 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%SSBOScalar = OpTypeStruct %v2float %v3float %v3float
%_ptr_Uniform_SSBOScalar = OpTypePointer Uniform %SSBOScalar
%_ = OpVariable %_ptr_Uniform_SSBOScalar Uniform
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
%int_2 = OpConstant %int 2
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%float_1 = OpConstant %float 1
%27 = OpConstantComposite %v3float %float_1 %float_1 %float_1
%main = OpFunction %void None %3
%5 = OpLabel
%16 = OpAccessChain %_ptr_Uniform_v3float %_ %int_1
%17 = OpLoad %v3float %16
%18 = OpVectorShuffle %v2float %17 %17 0 1
%20 = OpAccessChain %_ptr_Uniform_v3float %_ %int_2
%21 = OpLoad %v3float %20
%22 = OpVectorShuffle %v2float %21 %21 1 2
OpStore %16 %27
%23 = OpFMul %v2float %18 %22
%25 = OpAccessChain %_ptr_Uniform_v2float %_ %int_0
OpStore %25 %23
OpReturn
OpFunctionEnd