I encountered a case where a game provides an empty fragment shader, one that disassembles to just:
``` ps_5_0 dcl_globalFlags refactoringAllowed ``` which gets translated to:
``` OpCapability Shader OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %main "main" OpExecutionMode %main OriginUpperLeft OpName %main "main" %void = OpTypeVoid %3 = OpTypeFunction %void %main = OpFunction %void None %3 %4 = OpLabel OpFunctionEnd ```
This patch is to detect that the OpLabel has not been terminated by a corresponding top-level return, and add it.
-- v2: vkd3d-shader: Ensure that the OpLabel emitted vkd3d_spirv_builder_begin_main_function() gets terminated.