瀏覽代碼

spirv: Add OpKill fallback to demote

ReinUsesLisp 5 年之前
父節點
當前提交
fd913bceaf
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp

+ 6 - 2
src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp

@@ -35,8 +35,12 @@ void EmitUnreachable(EmitContext& ctx) {
 }
 
 void EmitDemoteToHelperInvocation(EmitContext& ctx, Id continue_label) {
-    ctx.OpDemoteToHelperInvocationEXT();
-    ctx.OpBranch(continue_label);
+    if (ctx.profile.support_demote_to_helper_invocation) {
+        ctx.OpDemoteToHelperInvocationEXT();
+        ctx.OpBranch(continue_label);
+    } else {
+        ctx.OpKill();
+    }
 }
 
 } // namespace Shader::Backend::SPIRV