Skip to content

vkd3d-shader/spirv: Always terminate main block.

Jan Sikorski requested to merge jsikorski/vkd3d:master into master

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.

Merge request reports

Loading