Skip to content

Commit

Permalink
[GPU] Check memexport stream constant upper bits in range gathering
Browse files Browse the repository at this point in the history
  • Loading branch information
Triang3l committed May 12, 2024
1 parent a3304d2 commit 3189a0e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/xenia/gpu/draw_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,14 @@ void AddMemExportRanges(const RegisterFile& regs, const Shader& shader,
for (uint32_t constant_index : shader.memexport_stream_constants()) {
xenos::xe_gpu_memexport_stream_t stream =
regs.GetMemExportStream(float_constants_base + constant_index);
if (!stream.index_count) {
// Safety checks for stream constants potentially not set up if the export
// isn't done on the control flow path taken by the shader (not checking the
// Y component because the index is more likely to be constructed
// arbitrarily).
// The hardware validates the upper bits of eA according to the
// IPR2015-00325 sequencer specification.
if (stream.const_0x1 != 0x1 || stream.const_0x4b0 != 0x4B0 ||
stream.const_0x96 != 0x96 || !stream.index_count) {
continue;
}
const FormatInfo& format_info =
Expand Down

0 comments on commit 3189a0e

Please sign in to comment.