more cleanup

This commit is contained in:
Frodo Baggins 2024-10-05 11:54:20 -07:00
parent e69b2d410c
commit fde78e5e10
5 changed files with 8 additions and 21 deletions

View file

@ -1,14 +1,9 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
#include <iterator>
#include <boost/container/small_vector.hpp>
#include "common/assert.h"
#include "shader_recompiler/backend/spirv/emit_spirv_instructions.h"
#include "shader_recompiler/backend/spirv/spirv_emit_context.h"
#include "shader_recompiler/ir/debug_print.h"
#include "shader_recompiler/ir/opcodes.h"
namespace Shader::Backend::SPIRV {
@ -61,8 +56,7 @@ void EmitDebugPrint(EmitContext& ctx, IR::Inst* inst, Id arg0, Id arg1, Id arg2,
Id fmt = ctx.String(format_string);
std::array<Id, 5> fmt_args = {arg0, arg1, arg2, arg3, arg4};
const std::span<Id> fmt_args_span =
std::span<Id>(fmt_args.begin(), fmt_args.begin() + flags.num_args);
auto fmt_args_span = std::span<Id>(fmt_args.begin(), fmt_args.begin() + flags.num_args);
ctx.OpDebugPrintf(fmt, fmt_args_span);
}

View file

@ -244,8 +244,6 @@ public:
std::array<SpirvAttribute, IR::NumParams> output_params{};
std::array<SpirvAttribute, IR::NumRenderTargets> frag_outputs{};
boost::container::small_vector<boost::container::small_vector<Id, 4>, 4> va_arg_lists;
private:
void DefineArithmeticTypes();
void DefineInterfaces();

View file

@ -1557,8 +1557,7 @@ void IREmitter::ImageWrite(const Value& handle, const Value& coords, const Value
}
void IREmitter::DebugPrint(std::string_view format,
boost::container::small_vector<Value, 5> format_args,
bool infer_specifiers) {
boost::container::small_vector<Value, 5> format_args) {
std::array<Value, 5> args;
for (int i = 0; i < format_args.size(); i++) {

View file

@ -4,9 +4,7 @@
#pragma once
#include <cstring>
#include <string_view>
#include <type_traits>
#include <boost/container/small_vector.hpp>
#include "shader_recompiler/info.h"
#include "shader_recompiler/ir/attribute.h"
@ -47,8 +45,7 @@ public:
void Epilogue();
void Discard();
void Discard(const U1& cond);
void DebugPrint(std::string_view format, boost::container::small_vector<Value, 5> args,
bool infer_specifiers = false);
void DebugPrint(std::string_view format, boost::container::small_vector<Value, 5> args);
void Barrier();
void WorkgroupMemoryBarrier();

View file

@ -22,12 +22,11 @@ Inst::Inst(IR::Opcode op_, u32 flags_) noexcept : op{op_}, flags{flags_} {
Inst::Inst(const Inst& base) : op{base.op}, flags{base.flags} {
if (base.op == Opcode::Phi) {
throw NotImplementedException("Copying phi node");
} else {
std::construct_at(&args);
const size_t num_args{base.NumArgs()};
for (size_t index = 0; index < num_args; ++index) {
SetArg(index, base.Arg(index));
}
}
std::construct_at(&args);
const size_t num_args{base.NumArgs()};
for (size_t index = 0; index < num_args; ++index) {
SetArg(index, base.Arg(index));
}
}