Skip to content

Commit

Permalink
Tess merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rainmakerv3 committed Dec 9, 2024
1 parent c0f2e14 commit 660d395
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
3 changes: 0 additions & 3 deletions src/shader_recompiler/ir/passes/constant_propagation_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,6 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
return a % b;
});
return;
case IR::Opcode::UDiv32:
FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a / b; });
return;
case IR::Opcode::FPCmpClass32:
FoldCmpClass(block, inst);
return;
Expand Down
8 changes: 4 additions & 4 deletions src/shader_recompiler/ir/passes/hull_shader_transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ std::optional<TessSharpLocation> FindTessConstantSharp(IR::Inst* read_const_buff
class TessConstantUseWalker {
public:
void MarkTessAttributeUsers(IR::Inst* get_attribute) {
uint inc;
int inc;
switch (get_attribute->Arg(0).Attribute()) {
case IR::Attribute::TcsNumPatches:
case IR::Attribute::TcsOutputBase:
Expand All @@ -196,7 +196,7 @@ class TessConstantUseWalker {
}

private:
void MarkTessAttributeUsersHelper(IR::Use use, uint inc) {
void MarkTessAttributeUsersHelper(IR::Use use, int inc) {
IR::Inst* inst = use.user;

switch (use.user->GetOpcode()) {
Expand All @@ -206,7 +206,7 @@ class TessConstantUseWalker {
case IR::Opcode::WriteSharedU32:
case IR::Opcode::WriteSharedU64:
case IR::Opcode::WriteSharedU128: {
uint counter = inst->Flags<u32>();
int counter = inst->Flags<u32>();
inst->SetFlags<u32>(counter + inc);
// Stop here
return;
Expand Down Expand Up @@ -252,7 +252,7 @@ class TessConstantUseWalker {
}
}

uint seq_num{1u};
int seq_num{1u};
};

enum class AttributeRegion : u32 { InputCP, OutputCP, PatchConst };
Expand Down
9 changes: 3 additions & 6 deletions src/shader_recompiler/ir/passes/ring_access_elimination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@

namespace Shader::Optimization {

void RingAccessElimination(const IR::Program& program, const RuntimeInfo& runtime_info) {
void RingAccessElimination(const IR::Program& program, const RuntimeInfo& runtime_info,
Stage stage) {
auto& info = program.info;

Stage stage = info.stage;
LogicalStage l_stage = info.l_stage;
SwHwStagePerm stage_perm = GetSwHwStagePerm(stage, l_stage);

const auto& ForEachInstruction = [&](auto func) {
for (IR::Block* block : program.blocks) {
for (IR::Inst& inst : block->Instructions()) {
Expand Down Expand Up @@ -91,7 +88,7 @@ void RingAccessElimination(const IR::Program& program, const RuntimeInfo& runtim
});
break;
}
case SwHwStagePerm::geometry_gs: {
case Stage::Geometry: {
const auto& gs_info = runtime_info.gs_info;
info.gs_copy_data = Shader::ParseCopyShader(gs_info.vs_copy);

Expand Down

0 comments on commit 660d395

Please sign in to comment.