Files
libretroadmin 61200aa5f8 GS: the draw transfers and the sprite draw list in C
GSState kept the EE's transfers into local memory since the last frame
(GSUploadQueue) and the runs of non-overlapping sprites of a draw in two
std::vectors, pushed to and read back from the end each transfer and
draw, walked backwards by the texture cache for the target a transfer
may fill, and cut at the front once a frame. They are in a gs_array
(GSArray.h, new, C89): elements of one size in one allocation that
doubles, pushed, erased at an index or from the front, with the type
named at the access. GSState hands the transfers out as a pointer and a
count (DrawTransfers, DrawTransferCount, LastDrawTransfer), and takes
them by PushDrawTransfer, PopDrawTransfer, EraseDrawTransfer and
ClearDrawTransfers; the reverse iterators became index walks, and an
erase in the middle of one goes on with the element before it, as the
iterator arithmetic did. The sprite draw list reaches the device as a
pointer and a count in GSHWDrawConfig (drawlist, drawlist_count) rather
than a pointer to the vector; the Vulkan and OpenGL devices read it so.
The list is reserved for two thousand runs when the state is made, as
it was, so a draw allocates nothing.

tests/gsarray holds the array against a model over random pushes,
erases, cuts and clears, built as C89. tests/swdraw presents the same
pictures on every case, and gstc, gspresent, vknegotiate, gsautoindex,
gsinterlace, savestate and secondload pass as before.
2026-11-03 02:48:43 +01:00

10 lines
382 B
Bash
Executable File

#!/bin/sh
# GSArray, the C growable array the draw transfers and the sprite draw
# list are kept in: checked against a model, built as C89.
set -e
DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
ROOT=$(CDPATH= cd -- "$DIR/../.." && pwd)
${CC:-cc} -std=c89 -pedantic -Wall -Wno-long-long -O2 -g $SANFLAGS -I "$ROOT/pcsx2" \
-o "$DIR/gsarray_test" "$DIR/main.c"
"$DIR/gsarray_test"