diff --git a/src/xenia/gpu/command_processor.cc b/src/xenia/gpu/command_processor.cc index 1d2afb53b..1c1376b9b 100644 --- a/src/xenia/gpu/command_processor.cc +++ b/src/xenia/gpu/command_processor.cc @@ -308,6 +308,11 @@ void CommandProcessor::CaptureUiDrawForRE( ui_out << fmt::format("\n vb=0x{:08X} stride={} attrs=[", vbase, stride); int32_t pos_off = -1; uint32_t pos_fmt = 0; + // The k_8_8_8_8 attribute is the per-vertex colour, and its ALPHA is what + // separates two elements that decode to the same size: the bundle gives + // them different resting fade alphas. Without it a draw of, say, 1133x280 + // could be either `ptlogo_back2eff` or `ptlogo_back2eff5`. + int32_t col_off = -1; for (const auto& attr : binding.attributes) { uint32_t f = uint32_t(attr.fetch_instr.attributes.data_format); uint32_t off = attr.fetch_instr.attributes.offset * 4; @@ -316,6 +321,11 @@ void CommandProcessor::CaptureUiDrawForRE( pos_off = int32_t(off); pos_fmt = f; } + if (col_off < 0 && + attr.fetch_instr.attributes.data_format == + xenos::VertexFormat::k_8_8_8_8) { + col_off = int32_t(off); + } } ui_out << "]"; if (stride && vbase && pos_off >= 0) { @@ -342,7 +352,15 @@ void CommandProcessor::CaptureUiDrawForRE( std::memcpy(&f0, &w0, 4); std::memcpy(&f1, &w1, 4); std::memcpy(&f2, &w2, 4); - ui_out << fmt::format(" [{:.2f},{:.2f},z={:.5f}]", f0, f1, f2); + ui_out << fmt::format(" [{:.2f},{:.2f},z={:.5f}", f0, f1, f2); + if (col_off >= 0) { + const uint8_t* c = memory_->TranslatePhysical( + vbase + v * stride + uint32_t(col_off)); + if (c) { + ui_out << fmt::format(",col={:08X}", be_u32(c)); + } + } + ui_out << "]"; } } }