mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-14 12:56:59 +02:00
[debug] Added extra parametters for histogram track info -> shader info for RZ
This commit is contained in:
parent
36bfb7b371
commit
e1c27dd69b
1 changed files with 51 additions and 0 deletions
|
|
@ -142,6 +142,55 @@ FpControlHistogram CollectFpControlHistogram(const IR::Program& program) {
|
||||||
return histogram;
|
return histogram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LogRzFpControlTrace(Environment& env, const IR::Program& program) {
|
||||||
|
std::array<u32, 2> totals{};
|
||||||
|
for (const IR::Block* const block : program.post_order_blocks) {
|
||||||
|
for (const IR::Inst& inst : block->Instructions()) {
|
||||||
|
const std::optional<size_t> bucket{FpControlBucket(inst.GetOpcode())};
|
||||||
|
if (!bucket) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const auto flags{inst.Flags<IR::FpControl>()};
|
||||||
|
if (flags.rounding != IR::FpRounding::RZ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
++totals[*bucket];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (totals[0] == 0 && totals[1] == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr std::array<std::string_view, 2> precision_names{"fp16", "fp32"};
|
||||||
|
LOG_INFO(Shader,
|
||||||
|
"FP_RZ {} shader start={:#010x} blocks={} post_order_blocks={} fp16={} fp32={}",
|
||||||
|
StageName(program.stage), env.StartAddress(), program.blocks.size(),
|
||||||
|
program.post_order_blocks.size(), totals[0], totals[1]);
|
||||||
|
|
||||||
|
for (const IR::Block* const block : program.post_order_blocks) {
|
||||||
|
u32 inst_index{};
|
||||||
|
for (const IR::Inst& inst : block->Instructions()) {
|
||||||
|
const std::optional<size_t> bucket{FpControlBucket(inst.GetOpcode())};
|
||||||
|
if (!bucket) {
|
||||||
|
++inst_index;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const auto flags{inst.Flags<IR::FpControl>()};
|
||||||
|
if (flags.rounding != IR::FpRounding::RZ) {
|
||||||
|
++inst_index;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
LOG_INFO(Shader,
|
||||||
|
"FP_RZ {} start={:#010x} block_order={} inst_index={} precision={} opcode={} no_contraction={} fmz={}",
|
||||||
|
StageName(program.stage), env.StartAddress(), block->GetOrder(), inst_index,
|
||||||
|
precision_names[*bucket], inst.GetOpcode(), flags.no_contraction,
|
||||||
|
FmzName(flags.fmz_mode));
|
||||||
|
++inst_index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void LogFpControlHistogram(const IR::Program& program) {
|
void LogFpControlHistogram(const IR::Program& program) {
|
||||||
const FpControlHistogram histogram{CollectFpControlHistogram(program)};
|
const FpControlHistogram histogram{CollectFpControlHistogram(program)};
|
||||||
if (histogram.total[0] == 0 && histogram.total[1] == 0) {
|
if (histogram.total[0] == 0 && histogram.total[1] == 0) {
|
||||||
|
|
@ -479,6 +528,7 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo
|
||||||
|
|
||||||
if (Settings::values.renderer_debug) {
|
if (Settings::values.renderer_debug) {
|
||||||
LogFpControlHistogram(program);
|
LogFpControlHistogram(program);
|
||||||
|
LogRzFpControlTrace(env, program);
|
||||||
}
|
}
|
||||||
|
|
||||||
CollectInterpolationInfo(env, program);
|
CollectInterpolationInfo(env, program);
|
||||||
|
|
@ -518,6 +568,7 @@ IR::Program MergeDualVertexPrograms(IR::Program& vertex_a, IR::Program& vertex_b
|
||||||
Optimization::CollectShaderInfoPass(env_vertex_b, result);
|
Optimization::CollectShaderInfoPass(env_vertex_b, result);
|
||||||
if (Settings::values.renderer_debug) {
|
if (Settings::values.renderer_debug) {
|
||||||
LogFpControlHistogram(result);
|
LogFpControlHistogram(result);
|
||||||
|
LogRzFpControlTrace(env_vertex_b, result);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue