mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-03 14:48:46 +00:00
remove string pool changes
This commit is contained in:
parent
6722f2805a
commit
7b1aae07ee
5 changed files with 14 additions and 19 deletions
|
@ -644,7 +644,7 @@ private:
|
||||||
}
|
}
|
||||||
case StatementType::SetVariable: {
|
case StatementType::SetVariable: {
|
||||||
ensure_block();
|
ensure_block();
|
||||||
IR::IREmitter ir{*current_block, info};
|
IR::IREmitter ir{*current_block};
|
||||||
ir.SetGotoVariable(stmt.id, VisitExpr(ir, *stmt.op));
|
ir.SetGotoVariable(stmt.id, VisitExpr(ir, *stmt.op));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -653,7 +653,7 @@ private:
|
||||||
IR::Block* const merge_block{MergeBlock(parent, stmt)};
|
IR::Block* const merge_block{MergeBlock(parent, stmt)};
|
||||||
|
|
||||||
// Implement if header block
|
// Implement if header block
|
||||||
IR::IREmitter ir{*current_block, info};
|
IR::IREmitter ir{*current_block};
|
||||||
const IR::U1 cond{ir.ConditionRef(VisitExpr(ir, *stmt.cond))};
|
const IR::U1 cond{ir.ConditionRef(VisitExpr(ir, *stmt.cond))};
|
||||||
|
|
||||||
const size_t if_node_index{syntax_list.size()};
|
const size_t if_node_index{syntax_list.size()};
|
||||||
|
@ -703,7 +703,7 @@ private:
|
||||||
Visit(stmt, merge_block, continue_block);
|
Visit(stmt, merge_block, continue_block);
|
||||||
|
|
||||||
// The continue block is located at the end of the loop
|
// The continue block is located at the end of the loop
|
||||||
IR::IREmitter ir{*continue_block, info};
|
IR::IREmitter ir{*continue_block};
|
||||||
const IR::U1 cond{ir.ConditionRef(VisitExpr(ir, *stmt.cond))};
|
const IR::U1 cond{ir.ConditionRef(VisitExpr(ir, *stmt.cond))};
|
||||||
|
|
||||||
IR::Block* const body_block{syntax_list.at(body_block_index).data.block};
|
IR::Block* const body_block{syntax_list.at(body_block_index).data.block};
|
||||||
|
@ -739,7 +739,7 @@ private:
|
||||||
ensure_block();
|
ensure_block();
|
||||||
IR::Block* const skip_block{MergeBlock(parent, stmt)};
|
IR::Block* const skip_block{MergeBlock(parent, stmt)};
|
||||||
|
|
||||||
IR::IREmitter ir{*current_block, info};
|
IR::IREmitter ir{*current_block};
|
||||||
const IR::U1 cond{ir.ConditionRef(VisitExpr(ir, *stmt.cond))};
|
const IR::U1 cond{ir.ConditionRef(VisitExpr(ir, *stmt.cond))};
|
||||||
current_block->AddBranch(break_block);
|
current_block->AddBranch(break_block);
|
||||||
current_block->AddBranch(skip_block);
|
current_block->AddBranch(skip_block);
|
||||||
|
@ -759,7 +759,7 @@ private:
|
||||||
case StatementType::Return: {
|
case StatementType::Return: {
|
||||||
ensure_block();
|
ensure_block();
|
||||||
IR::Block* return_block{block_pool.Create(inst_pool)};
|
IR::Block* return_block{block_pool.Create(inst_pool)};
|
||||||
IR::IREmitter{*return_block, info}.Epilogue();
|
IR::IREmitter{*return_block}.Epilogue();
|
||||||
current_block->AddBranch(return_block);
|
current_block->AddBranch(return_block);
|
||||||
|
|
||||||
auto& merge{syntax_list.emplace_back()};
|
auto& merge{syntax_list.emplace_back()};
|
||||||
|
@ -773,7 +773,7 @@ private:
|
||||||
case StatementType::Kill: {
|
case StatementType::Kill: {
|
||||||
ensure_block();
|
ensure_block();
|
||||||
IR::Block* demote_block{MergeBlock(parent, stmt)};
|
IR::Block* demote_block{MergeBlock(parent, stmt)};
|
||||||
IR::IREmitter{*current_block, info}.Discard();
|
IR::IREmitter{*current_block}.Discard();
|
||||||
current_block->AddBranch(demote_block);
|
current_block->AddBranch(demote_block);
|
||||||
current_block = demote_block;
|
current_block = demote_block;
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,7 @@ namespace Shader::Gcn {
|
||||||
|
|
||||||
Translator::Translator(IR::Block* block_, Info& info_, const RuntimeInfo& runtime_info_,
|
Translator::Translator(IR::Block* block_, Info& info_, const RuntimeInfo& runtime_info_,
|
||||||
const Profile& profile_)
|
const Profile& profile_)
|
||||||
: ir{*block_, block_->begin(), info_}, info{info_}, runtime_info{runtime_info_},
|
: ir{*block_, block_->begin()}, info{info_}, runtime_info{runtime_info_}, profile{profile_} {}
|
||||||
profile{profile_} {}
|
|
||||||
|
|
||||||
void Translator::EmitPrologue() {
|
void Translator::EmitPrologue() {
|
||||||
ir.Prologue();
|
ir.Prologue();
|
||||||
|
|
|
@ -180,8 +180,6 @@ struct Info {
|
||||||
std::span<const u32> user_data;
|
std::span<const u32> user_data;
|
||||||
Stage stage;
|
Stage stage;
|
||||||
|
|
||||||
std::vector<std::string> string_pool;
|
|
||||||
|
|
||||||
u64 pgm_hash{};
|
u64 pgm_hash{};
|
||||||
VAddr pgm_base;
|
VAddr pgm_base;
|
||||||
bool has_storage_images{};
|
bool has_storage_images{};
|
||||||
|
|
|
@ -16,10 +16,9 @@ namespace Shader::IR {
|
||||||
|
|
||||||
class IREmitter {
|
class IREmitter {
|
||||||
public:
|
public:
|
||||||
explicit IREmitter(Block& block_, Shader::Info& info_)
|
explicit IREmitter(Block& block_) : block{&block_}, insertion_point{block->end()} {}
|
||||||
: block{&block_}, insertion_point{block->end()}, info(info_) {}
|
explicit IREmitter(Block& block_, Block::iterator insertion_point_)
|
||||||
explicit IREmitter(Block& block_, Block::iterator insertion_point_, Shader::Info& info_)
|
: block{&block_}, insertion_point{insertion_point_} {}
|
||||||
: block{&block_}, insertion_point{insertion_point_}, info(info_) {}
|
|
||||||
|
|
||||||
Block* block;
|
Block* block;
|
||||||
|
|
||||||
|
@ -315,7 +314,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IR::Block::iterator insertion_point;
|
IR::Block::iterator insertion_point;
|
||||||
Shader::Info& info;
|
|
||||||
|
|
||||||
template <typename T = Value, typename... Args>
|
template <typename T = Value, typename... Args>
|
||||||
T Inst(Opcode op, Args... args) {
|
T Inst(Opcode op, Args... args) {
|
||||||
|
|
|
@ -377,7 +377,7 @@ void PatchBufferInstruction(IR::Block& block, IR::Inst& inst, Info& info,
|
||||||
const auto inst_info = inst.Flags<IR::BufferInstInfo>();
|
const auto inst_info = inst.Flags<IR::BufferInstInfo>();
|
||||||
|
|
||||||
// Replace handle with binding index in buffer resource list.
|
// Replace handle with binding index in buffer resource list.
|
||||||
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst), info};
|
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)};
|
||||||
inst.SetArg(0, ir.Imm32(binding));
|
inst.SetArg(0, ir.Imm32(binding));
|
||||||
ASSERT(!buffer.add_tid_enable);
|
ASSERT(!buffer.add_tid_enable);
|
||||||
|
|
||||||
|
@ -436,7 +436,7 @@ void PatchTextureBufferInstruction(IR::Block& block, IR::Inst& inst, Info& info,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Replace handle with binding index in texture buffer resource list.
|
// Replace handle with binding index in texture buffer resource list.
|
||||||
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst), info};
|
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)};
|
||||||
inst.SetArg(0, ir.Imm32(binding));
|
inst.SetArg(0, ir.Imm32(binding));
|
||||||
ASSERT(!buffer.swizzle_enable && !buffer.add_tid_enable);
|
ASSERT(!buffer.swizzle_enable && !buffer.add_tid_enable);
|
||||||
}
|
}
|
||||||
|
@ -534,7 +534,7 @@ void PatchImageInstruction(IR::Block& block, IR::Inst& inst, Info& info, Descrip
|
||||||
image_binding |= (sampler_binding << 16);
|
image_binding |= (sampler_binding << 16);
|
||||||
|
|
||||||
// Patch image handle
|
// Patch image handle
|
||||||
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst), info};
|
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)};
|
||||||
inst.SetArg(0, ir.Imm32(image_binding));
|
inst.SetArg(0, ir.Imm32(image_binding));
|
||||||
|
|
||||||
// No need to patch coordinates if we are just querying.
|
// No need to patch coordinates if we are just querying.
|
||||||
|
@ -667,7 +667,7 @@ void PatchDataRingInstruction(IR::Block& block, IR::Inst& inst, Info& info,
|
||||||
}();
|
}();
|
||||||
|
|
||||||
// Patch instruction.
|
// Patch instruction.
|
||||||
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst), info};
|
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)};
|
||||||
inst.SetArg(0, ir.Imm32(gds_addr >> 2));
|
inst.SetArg(0, ir.Imm32(gds_addr >> 2));
|
||||||
inst.SetArg(1, ir.Imm32(binding));
|
inst.SetArg(1, ir.Imm32(binding));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue