2024-05-22 00:35:12 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#include "shader_recompiler/backend/spirv/emit_spirv_instructions.h"
|
|
|
|
#include "shader_recompiler/backend/spirv/spirv_emit_context.h"
|
|
|
|
|
|
|
|
namespace Shader::Backend::SPIRV {
|
|
|
|
|
2024-08-13 08:21:48 +02:00
|
|
|
void EmitPrologue(EmitContext& ctx) {
|
|
|
|
ctx.DefineBufferOffsets();
|
|
|
|
}
|
2024-05-22 00:35:12 +02:00
|
|
|
|
|
|
|
void EmitEpilogue(EmitContext& ctx) {}
|
|
|
|
|
2024-05-29 00:28:34 +02:00
|
|
|
void EmitDiscard(EmitContext& ctx) {
|
|
|
|
ctx.OpDemoteToHelperInvocationEXT();
|
|
|
|
}
|
|
|
|
|
2024-07-13 14:40:39 +02:00
|
|
|
void EmitDiscardCond(EmitContext& ctx, Id condition) {
|
|
|
|
const Id kill_label{ctx.OpLabel()};
|
|
|
|
const Id merge_label{ctx.OpLabel()};
|
|
|
|
ctx.OpSelectionMerge(merge_label, spv::SelectionControlMask::MaskNone);
|
|
|
|
ctx.OpBranchConditional(condition, kill_label, merge_label);
|
|
|
|
ctx.AddLabel(kill_label);
|
|
|
|
ctx.OpDemoteToHelperInvocationEXT();
|
|
|
|
ctx.OpBranch(merge_label);
|
|
|
|
ctx.AddLabel(merge_label);
|
|
|
|
}
|
|
|
|
|
2024-05-22 00:35:12 +02:00
|
|
|
void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) {
|
|
|
|
throw NotImplementedException("Geometry streams");
|
|
|
|
}
|
|
|
|
|
|
|
|
void EmitEndPrimitive(EmitContext& ctx, const IR::Value& stream) {
|
|
|
|
throw NotImplementedException("Geometry streams");
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Shader::Backend::SPIRV
|