mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-24 19:14:40 +00:00
shader_recompiler: Use VM bit for conditional discard (#3306)
This commit is contained in:
parent
8dc50ffc79
commit
19c3d05ac1
@ -319,8 +319,6 @@ void CFG::LinkBlocks() {
|
||||
// need to link with the next block.
|
||||
if (!end_inst.IsTerminateInstruction()) {
|
||||
auto* next_block = get_block(block.end);
|
||||
++next_block->num_predecessors;
|
||||
|
||||
block.branch_true = next_block;
|
||||
block.end_class = EndClass::Branch;
|
||||
continue;
|
||||
@ -343,17 +341,11 @@ void CFG::LinkBlocks() {
|
||||
|
||||
if (end_inst.IsUnconditionalBranch()) {
|
||||
auto* target_block = get_block(target_pc);
|
||||
++target_block->num_predecessors;
|
||||
|
||||
block.branch_true = target_block;
|
||||
block.end_class = EndClass::Branch;
|
||||
} else if (end_inst.IsConditionalBranch()) {
|
||||
auto* target_block = get_block(target_pc);
|
||||
++target_block->num_predecessors;
|
||||
|
||||
auto* end_block = get_block(block.end);
|
||||
++end_block->num_predecessors;
|
||||
|
||||
block.branch_true = target_block;
|
||||
block.branch_false = end_block;
|
||||
block.end_class = EndClass::Branch;
|
||||
|
@ -38,7 +38,6 @@ struct Block : Hook {
|
||||
u32 end;
|
||||
u32 begin_index;
|
||||
u32 end_index;
|
||||
u32 num_predecessors{};
|
||||
IR::Condition cond{};
|
||||
GcnInst end_inst{};
|
||||
EndClass end_class{};
|
||||
|
@ -635,7 +635,6 @@ private:
|
||||
case StatementType::Code: {
|
||||
ensure_block();
|
||||
if (!stmt.block->is_dummy) {
|
||||
current_block->has_multiple_predecessors = stmt.block->num_predecessors > 1;
|
||||
const u32 start = stmt.block->begin_index;
|
||||
const u32 size = stmt.block->end_index - start + 1;
|
||||
translator.Translate(current_block, stmt.block->begin,
|
||||
|
@ -133,7 +133,7 @@ void Translator::ExportUncompressed(IR::Attribute attribute, u32 comp, const IR:
|
||||
}
|
||||
|
||||
void Translator::EmitExport(const GcnInst& inst) {
|
||||
if (ir.block->has_multiple_predecessors && info.stage == Stage::Fragment) {
|
||||
if (info.stage == Stage::Fragment && inst.control.exp.vm) {
|
||||
ir.Discard(ir.LogicalNot(ir.GetExec()));
|
||||
}
|
||||
|
||||
|
@ -150,8 +150,6 @@ public:
|
||||
std::array<Value, NumScalarRegs> ssa_sbit_values;
|
||||
std::array<Value, NumVectorRegs> ssa_vreg_values;
|
||||
|
||||
bool has_multiple_predecessors{false};
|
||||
|
||||
private:
|
||||
/// Memory pool for instruction list
|
||||
Common::ObjectPool<Inst>* inst_pool;
|
||||
|
Loading…
Reference in New Issue
Block a user