diff --git a/src/xenia/gpu/command_processor.cc b/src/xenia/gpu/command_processor.cc index 68670281d..89863b6ee 100644 --- a/src/xenia/gpu/command_processor.cc +++ b/src/xenia/gpu/command_processor.cc @@ -227,6 +227,29 @@ void CommandProcessor::CaptureShipDrawForRE( be_f32(p + 8)); } cap_out << "\n"; + + // Vertex-shader float constants: the buffer holds LOCAL positions, so the + // per-part world (or world-view-projection) matrix that places the part lives + // here as a run of float4 constants. Diffing two parts' constants isolates the + // matrix (the camera VP block is shared). Dump the first 48 vec4 from the VS + // constant base as host-float (the register file stores them host-endian). + auto vsc = register_file_->Get(); + uint32_t cbase = vsc.base; // starting float4 index + cap_out << fmt::format(" vsconst base={}:", cbase); + for (uint32_t i = 0; i < 48; ++i) { + uint32_t idx = cbase + i; + if (idx >= 256) { + break; + } + uint32_t r = XE_GPU_REG_SHADER_CONSTANT_000_X + 4 * idx; + float cx = register_file_->Get(r); + float cy = register_file_->Get(r + 1); + float cz = register_file_->Get(r + 2); + float cw = register_file_->Get(r + 3); + cap_out << fmt::format(" c{}=({:.4f},{:.4f},{:.4f},{:.4f})", i, cx, cy, cz, + cw); + } + cap_out << "\n"; cap_out.flush(); }