2022-04-23 08:59:50 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2021-02-08 05:54:35 +00:00
|
|
|
|
2021-05-03 23:53:00 +00:00
|
|
|
#include "shader_recompiler/backend/spirv/emit_spirv_instructions.h"
|
2021-12-05 22:24:54 +00:00
|
|
|
#include "shader_recompiler/backend/spirv/spirv_emit_context.h"
|
2021-02-16 07:10:22 +00:00
|
|
|
|
|
|
|
namespace Shader::Backend::SPIRV {
|
|
|
|
|
2021-04-18 23:03:38 +00:00
|
|
|
void EmitJoin(EmitContext&) {
|
|
|
|
throw NotImplementedException("Join shouldn't be emitted");
|
|
|
|
}
|
|
|
|
|
2021-05-14 03:40:54 +00:00
|
|
|
void EmitDemoteToHelperInvocation(EmitContext& ctx) {
|
2021-05-23 07:20:37 +00:00
|
|
|
if (ctx.profile.support_demote_to_helper_invocation) {
|
2022-11-23 00:14:46 +00:00
|
|
|
ctx.OpDemoteToHelperInvocation();
|
2021-05-23 07:20:37 +00:00
|
|
|
} else {
|
2021-05-14 03:40:54 +00:00
|
|
|
const Id kill_label{ctx.OpLabel()};
|
|
|
|
const Id impossible_label{ctx.OpLabel()};
|
|
|
|
ctx.OpSelectionMerge(impossible_label, spv::SelectionControlMask::MaskNone);
|
|
|
|
ctx.OpBranchConditional(ctx.true_value, kill_label, impossible_label);
|
|
|
|
ctx.AddLabel(kill_label);
|
2021-05-23 07:20:37 +00:00
|
|
|
ctx.OpKill();
|
2021-05-14 03:40:54 +00:00
|
|
|
ctx.AddLabel(impossible_label);
|
2021-05-23 07:20:37 +00:00
|
|
|
}
|
2021-03-19 22:28:31 +00:00
|
|
|
}
|
|
|
|
|
2021-02-16 07:10:22 +00:00
|
|
|
} // namespace Shader::Backend::SPIRV
|