mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 12:21:35 +00:00
The generators were not setting `emit_continuing_` when emitting while loops. This caused a crash when a `continue` was encountered. This CL adds the `emit_continuing_` setup to the while emission. It also guards the `emit_continuing_` usage with making sure the function is setup. Bug: tint:1490 Change-Id: Ia89c49e567acda71a1f851a582103723cff71d49 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93960 Commit-Queue: Dan Sinclair <dsinclair@chromium.org> Auto-Submit: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.3
|
|
; Generator: Google Tint Compiler; 0
|
|
; Bound: 27
|
|
; Schema: 0
|
|
OpCapability Shader
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
|
|
OpExecutionMode %unused_entry_point LocalSize 1 1 1
|
|
OpName %unused_entry_point "unused_entry_point"
|
|
OpName %f "f"
|
|
OpName %i "i"
|
|
%void = OpTypeVoid
|
|
%1 = OpTypeFunction %void
|
|
%int = OpTypeInt 32 1
|
|
%5 = OpTypeFunction %int
|
|
%_ptr_Function_int = OpTypePointer Function %int
|
|
%11 = OpConstantNull %int
|
|
%int_4 = OpConstant %int 4
|
|
%bool = OpTypeBool
|
|
%int_1 = OpConstant %int 1
|
|
%unused_entry_point = OpFunction %void None %1
|
|
%4 = OpLabel
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%f = OpFunction %int None %5
|
|
%8 = OpLabel
|
|
%i = OpVariable %_ptr_Function_int Function %11
|
|
OpBranch %12
|
|
%12 = OpLabel
|
|
OpLoopMerge %13 %14 None
|
|
OpBranch %15
|
|
%15 = OpLabel
|
|
%17 = OpLoad %int %i
|
|
%19 = OpSLessThan %bool %17 %int_4
|
|
%16 = OpLogicalNot %bool %19
|
|
OpSelectionMerge %21 None
|
|
OpBranchConditional %16 %22 %21
|
|
%22 = OpLabel
|
|
OpBranch %13
|
|
%21 = OpLabel
|
|
%23 = OpLoad %int %i
|
|
%25 = OpIAdd %int %23 %int_1
|
|
OpStore %i %25
|
|
OpBranch %14
|
|
%14 = OpLabel
|
|
OpBranch %12
|
|
%13 = OpLabel
|
|
%26 = OpLoad %int %i
|
|
OpReturnValue %26
|
|
OpFunctionEnd
|