mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 05:46:56 +01:00
shader_recompiler: add SSA
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
|
||||
#include "graphics/shader/recompiler/ir/Type.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
|
||||
namespace Libs::Graphics::ShaderRecompiler::IR {
|
||||
|
||||
enum class ValueOpcode {
|
||||
#define VALUE_OPCODE(name, ...) name,
|
||||
#include "graphics/shader/recompiler/ir/opcodes/ValueOpcodes.inc"
|
||||
#undef VALUE_OPCODE
|
||||
Count,
|
||||
};
|
||||
|
||||
struct DppMoveFlags {
|
||||
uint16_t control = 0;
|
||||
uint8_t row_mask = 0xf;
|
||||
uint8_t bank_mask = 0xf;
|
||||
bool fetch_inactive = false;
|
||||
bool bound_control = false;
|
||||
};
|
||||
static_assert(sizeof(DppMoveFlags) <= sizeof(uint64_t));
|
||||
static_assert(std::is_trivially_copyable_v<DppMoveFlags>);
|
||||
|
||||
struct PermlaneFlags {
|
||||
bool x16 = false;
|
||||
bool fetch_inactive = false;
|
||||
bool bound_control = false;
|
||||
};
|
||||
static_assert(sizeof(PermlaneFlags) <= sizeof(uint64_t));
|
||||
static_assert(std::is_trivially_copyable_v<PermlaneFlags>);
|
||||
|
||||
struct MemoryFlags {
|
||||
uint32_t index = 0;
|
||||
uint32_t pc = 0;
|
||||
};
|
||||
static_assert(sizeof(MemoryFlags) == sizeof(uint64_t));
|
||||
static_assert(std::is_trivially_copyable_v<MemoryFlags>);
|
||||
|
||||
struct ExportFlags {
|
||||
uint32_t index = 0;
|
||||
uint32_t pc = 0;
|
||||
};
|
||||
static_assert(sizeof(ExportFlags) == sizeof(uint64_t));
|
||||
static_assert(std::is_trivially_copyable_v<ExportFlags>);
|
||||
|
||||
[[nodiscard]] Type TypeOf(ValueOpcode opcode);
|
||||
[[nodiscard]] Type ArgTypeOf(ValueOpcode opcode, size_t index);
|
||||
[[nodiscard]] size_t NumArgsOf(ValueOpcode opcode);
|
||||
[[nodiscard]] bool HasSideEffects(ValueOpcode opcode);
|
||||
[[nodiscard]] std::string_view ValueOpcodeName(ValueOpcode opcode);
|
||||
|
||||
} // namespace Libs::Graphics::ShaderRecompiler::IR
|
||||
Reference in New Issue
Block a user