diff --git a/.github/workflows/reusable-check-rendering.yml b/.github/workflows/reusable-check-rendering.yml index f7072027f7a..63e85846dbe 100644 --- a/.github/workflows/reusable-check-rendering.yml +++ b/.github/workflows/reusable-check-rendering.yml @@ -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" diff --git a/Tests/Rendering/README.md b/Tests/Rendering/README.md index ccec8ab8a75..3615a357f61 100644 --- a/Tests/Rendering/README.md +++ b/Tests/Rendering/README.md @@ -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 `-rendering-report.html` artifact with the base, result and difference diff --git a/Tests/Rendering/d3d8_probe.cpp b/Tests/Rendering/d3d8_probe.cpp index 209fb5fa99c..9ce0249affc 100644 --- a/Tests/Rendering/d3d8_probe.cpp +++ b/Tests/Rendering/d3d8_probe.cpp @@ -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} };