Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/reusable-check-rendering.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,25 @@ jobs:
pull_request) base=$(gh api "repos/$GITHUB_REPOSITORY/compare/$PR_BASE...$PR_HEAD_OWNER:$PR_HEAD" --jq .merge_base_commit.sha) || base="" ;;
*) base=$(gh api "repos/$GITHUB_REPOSITORY/compare/main...$GITHUB_SHA" --jq .merge_base_commit.sha) || base="" ;;
esac
runs=""
# A commit has no package when it was pushed together with later commits, or when its run
# skipped this game's build because nothing it builds from changed. The nearest ancestor
# with a package then renders the same.
commits=""
if [ -n "$base" ]; then
runs=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs?head_sha=$base" \
--jq ".workflow_runs[] | select(.id != $GITHUB_RUN_ID) | .id") || runs=""
commits=$(gh api "repos/$GITHUB_REPOSITORY/commits?sha=$base&per_page=20" --jq '.[].sha') || commits=""
fi
for run in $runs; do
if gh run download "$run" --repo "$GITHUB_REPOSITORY" --name "$GAME-win32-rendering-tests" \
--dir build/rendering-tests-base; then
echo "Using the rendering tests of run $run for base commit $base"
echo "sha=$base" >> "$GITHUB_OUTPUT"
exit 0
fi
rm -rf build/rendering-tests-base
for commit in $commits; do
runs=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs?head_sha=$commit" \
--jq ".workflow_runs[] | select(.id != $GITHUB_RUN_ID) | .id") || runs=""
for run in $runs; do
if gh run download "$run" --repo "$GITHUB_REPOSITORY" --name "$GAME-win32-rendering-tests" \
--dir build/rendering-tests-base; then
echo "Using the rendering tests of run $run for commit $commit (base commit $base)"
echo "sha=$commit" >> "$GITHUB_OUTPUT"
exit 0
fi
rm -rf build/rendering-tests-base
done
done
echo "::notice title=Rendering::No rendering tests found for base commit ${base:-unknown}, so the images are not compared"

Expand Down
4 changes: 3 additions & 1 deletion Tests/Rendering/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ come from the Ubuntu 24.04 package repositories; these can receive updates.

There are no stored reference images. The job also downloads the rendering test
package of the base commit from its earlier GenCI run: the previous `main` commit
for a push, otherwise the merge base with `main`. It runs both executables under
for a push, otherwise the merge base with `main`. If that commit has no package,
because it was pushed together with later commits or its build was skipped, the
nearest ancestor with one renders the same and is used. It runs both executables under
the same Wine, Mesa and DXVK, so a difference in the images comes from the code.
`compare.py` compares every BMP and writes a job summary table and a
`<game>-rendering-report.html` artifact with the base, result and difference
Expand Down
2 changes: 1 addition & 1 deletion Tests/Rendering/d3d8_probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool RunD3D8Probe(const char *output)
Check(device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE), "Color arg");
struct Vertex { float x, y, z, rhw; DWORD color; };
const Vertex vertices[] = {
{128, 32, 0.5f, 1, 0xffff0000},
{136, 32, 0.5f, 1, 0xffff0000},
{224, 224, 0.5f, 1, 0xff00ff00},
{32, 224, 0.5f, 1, 0xff0000ff}
};
Expand Down
Loading