[GPU] ship-capture: also dump VS float constants (the placement matrix)
Some checks failed
Orchestrator / Commit Message Validation (push) Has been skipped
Orchestrator / Lint (push) Failing after 1m51s
Orchestrator / Windows (x86-64) (push) Has been skipped
Orchestrator / Linux (x86-64) (push) Has been skipped
Orchestrator / Create Release (push) Has been skipped

The captured vertex BUFFER holds LOCAL positions (byte-identical to the .xpr) —
capital-ship parts are placed entirely in the vertex shader, not in the buffer.
So the per-part world/WVP matrix lives in the VS float constants. Extend the F10
capture to dump the first 48 vec4 from the SQ_VS_CONST base per draw; diffing two
parts isolates the world matrix (the camera VP block is shared across draws).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-07-24 10:18:40 +02:00
parent 87d02d59f1
commit 3ba56a5005

View File

@@ -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<reg::SQ_VS_CONST>();
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<float>(r);
float cy = register_file_->Get<float>(r + 1);
float cz = register_file_->Get<float>(r + 2);
float cw = register_file_->Get<float>(r + 3);
cap_out << fmt::format(" c{}=({:.4f},{:.4f},{:.4f},{:.4f})", i, cx, cy, cz,
cw);
}
cap_out << "\n";
cap_out.flush();
}