Commit Graph
127940 Commits
Author SHA1 Message Date
Erik Abair 0103939ba4 nv2a: Fix R12 input in paired/multiout ops writing to oPos
Paired MAC+ILU and duplicate output instructions can write to oPos while reading
from R12. This leads to a case where xemu's serialized emulation erroneously
uses the output of a previous instruction when calculating the value of a later
one.

E.g., in

```
 /* 0x00000000 0x0080201A 0xC4002868 0x7CB0E800 */
 MAD oPos.xyz, R12.xyz, R1.x, C[1].xyz
   +  MAD R11.xy, R12.xyz, R1.x, C[1].xyz
```

the value of oPos prior to the first instruction should be used for both MAD
calculations.

This could alternatively be fixed by writing oPos to a temp vector and deferring
the output vector update until after the token is fully processed.

Note that we always process output registers writes before temp register writes
so the only interesting case should be the oPos/R12 alias. An op that writes to
one of its temp inputs will always execute the non-modifying output register
write before updating the temp register.

[Tests](https://github.com/abaire/nxdk_pgraph_tests/blob/1745a45290a5d607f9582303d6882cbf62f003de/src/tests/vertex_shader_independence_tests.cpp#L125)
[HW results](https://abaire.github.io/nxdk_pgraph_tests_golden_results/results/Vertex_shader_independence_tests/index.html)
2026-10-17 02:16:54 -07:00
Erik Abair 4d311d6ee3 nv2a: Fix epoxy flake using debug funcs on macOS 2026-10-17 02:12:19 -07:00
Erik Abair f78d85efb4 nv2a: Fix handling of color/zeta offset with RAM addresses 2026-10-16 23:48:36 -07:00
Erik Abair 04f12b57d0 nv2a: Fix material color source ambient and emissive 2026-10-16 22:50:36 -07:00
wutno 5906e2b556 nv2a: Always report PFIFO CACHE1_DMA_CTL as valid 2026-10-16 22:36:56 -07:00
Erik Abair 5c516ff05f nv2a: Fix specular param handling
This removes the curve fitting approximation added by PR #2079 and implements
the calculation described in https://patents.google.com/patent/US6417851B1/en
that is likely used in hardware.

Tests: https://github.com/abaire/nxdk_pgraph_tests/blob/d93ef924f395290d40f57e33d589fc3bafb22f32/src/tests/specular_tests.cpp
HW results: https://abaire.github.io/nxdk_pgraph_tests_golden_results/results/Specular/index.html

PR results:

Fixes #3075
2026-10-16 22:21:59 -07:00
Erik Abair 41fa73d44c nv2a: Only enable point sprites when rendering points
On hardware, point sprites are only rendered when rendering point primitives,
or when the polygon fill mode is set to `point`, provided that the primitive
mode is not one of the `LINE` variants.

This checks the current primitive and fill mode before enabling point sprites
in the pixel shader.

Test: https://github.com/abaire/nxdk_pgraph_tests/blob/b5949789e2ec1f946614b89228f93de977c30f58/src/tests/point_sprite_tests.cpp#L373
HW: https://abaire.github.io/nxdk_pgraph_tests_golden_results/results/Point_sprite/index.html#PolygonMode_Point

Fixes #3093
2026-10-16 22:21:07 -07:00
Erik Abair ac72edfc2b nv2a: Fix/implement Y16 texture formats
This adds support for NV097_SET_TEXTURE_FORMAT_COLOR_SZ_Y16 and fixes the
implementation of NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_Y16 so that the
results match hardware.

Tests: https://github.com/abaire/nxdk_pgraph_tests/blob/f85ce6cc8264d870a9c74fa908fce374ad9208c4/src/tests/texture_format_tests.cpp

HW results: https://abaire.github.io/nxdk_pgraph_tests_golden_results/results/Texture_format/index.html

Fixes #2657

---

Used Claude Sonnet 4.6 since this was primarily an extension of the existing
test. I had forgotten that the linear Y16 output was incorrect so I had it
fix that as well.
2026-10-16 16:50:01 -07:00
Erik Abair 5c59ae22e4 nv2a: Implement texgen view model
Implements the "infinite viewer" texgen view model mode.

Tests: https://github.com/abaire/nxdk_pgraph_tests/blob/47c7a7a82ba64d69522b110a52297515900429af/src/tests/texgen_tests.cpp

HW results: https://abaire.github.io/nxdk_pgraph_tests_golden_results/results/Texgen/index.html

Fixes #3086
2026-10-16 16:32:51 -07:00
Erik Abair e7a681cf7f nv2a: Implement clamping of passthru values
Hardware clamps passthru values to 0, 1.

Tests:
* https://github.com/abaire/nxdk_pgraph_tests/blob/47c7a7a82ba64d69522b110a52297515900429af/src/tests/pixel_shader_tests.cpp#L147
* https://github.com/abaire/nxdk_pgraph_tests/blob/689360d2c9d27e7cf99f4780c2afb61239082249/src/tests/texgen_matrix_tests.cpp#L507

HW results:
* https://abaire.github.io/nxdk_pgraph_tests_golden_results/results/Pixel_shader/index.html#PassthruClamping
* https://abaire.github.io/nxdk_pgraph_tests_golden_results/results/Texgen_with_texture_matrix/index.html

Fixes #2523
2026-10-16 16:31:46 -07:00
Erik Abair 136fa4fac9 nv2a: Implement spotlight falloff 2026-10-16 16:31:06 -07:00
Erik Abair ce540513e7 ci: Run xemu-test on PRs 2026-10-16 13:53:18 -07:00
Erik Abair 3eff3370f6 nv2a: Remove unconfirmed message for empty begin/end groups
Testing on hardware shows that empty draws are just ignored.
Furthermore, an empty begin/end followed by vertices with an end (no begin) is
ignored.

Tests: https://github.com/abaire/nxdk_pgraph_tests/blob/7e0e350cc0742cd63e0c9d98dc70b0def22e0fd7/src/tests/degenerate_begin_end_tests.cpp#L235
2026-10-16 12:54:34 -07:00
xemu-robot 36334d95b8 meson: Bump sdl3 to release-3.4.18 v0.8.137 2026-10-12 12:40:50 -07:00
xemu-robot e21beb760d meson: Bump SPIRV-Reflect to vulkan-sdk-1.4.363.0 2026-10-12 12:40:20 -07:00
dependabot[bot] 4ee7d19ce7 ci: bump astral-sh/setup-uv from 10.2.0 to 10.3.0
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 10.2.0 to 10.3.0.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/c18668ad3cf93ea998bef934396af7bb5c839dc7...1c37ad07a6a961277cf70c0d37d6f313000f5884)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-12 12:38:15 -07:00
dependabot[bot] 5dbe77aec3 ci: bump actions/upload-artifact from 7.0.1 to 7.0.2
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.1 to 7.0.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-12 12:37:18 -07:00
dependabot[bot] e23d50dafd ci: bump actions/download-artifact from 8.0.1 to 8.0.2
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-12 12:37:05 -07:00
dependabot[bot] 478b4f4961 ci: bump docker/setup-buildx-action from 4.3.0 to 4.4.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 4.3.0 to 4.4.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/37fe631027851001ddb9b187196cc803df7f5f0e...f87e5991a6d7451dcb8d9637bfbc97413f497069)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-28 23:19:32 -07:00
dependabot[bot] 2f4369b2d1 ci: bump docker/build-push-action from 7.3.0 to 7.4.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 7.3.0 to 7.4.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/53b7df96c91f9c12dcc8a07bcb9ccacbed38856a...c3c9e263c25d99ce0380d002d59b67737d91b0dc)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-28 23:19:18 -07:00
dependabot[bot] 1be29406b6 ci: bump astral-sh/setup-uv from 10.1.0 to 10.2.0
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 10.1.0 to 10.2.0.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/bec219d24cd3e171d82865faccec33120bb574f4...c18668ad3cf93ea998bef934396af7bb5c839dc7)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-28 23:19:04 -07:00
Erik Abair 484269acd2 doc: Add scope and design philosophy 2026-09-28 22:36:24 -07:00
xemu-robot f9b14039e5 meson: Bump glslang to 16.6.0 2026-09-14 02:10:54 -07:00
dependabot[bot] 50c664c00e ci: bump astral-sh/setup-uv from 10.0.1 to 10.1.0
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 10.0.1 to 10.1.0.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/20cfd1bf945f4377ade1205e4dbc17946fc9a30d...bec219d24cd3e171d82865faccec33120bb574f4)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-13 22:38:28 -07:00
Erik Abair 75650bd8cd nv2a: Fix rounding issue in timer scheduling 2026-09-09 15:53:30 -07:00
Erik Abair 9f43d060b0 docs: Add style exceptions for variable declaration location and comments 2026-09-09 15:35:59 -07:00
xemu-robot fdfb5a8f48 meson: Bump sdl3 to release-3.4.16 2026-09-08 04:47:56 -07:00
xemu-robot 123e4b7db5 meson: Bump nlohmann_json to v3.12.0 2026-09-08 04:45:30 -07:00
Matt Borgerson 6ccd229c74 meson: Track nlohmann_json with a git wrap
json.wrap tracked WrapDB's legacy json package, which has been frozen at
3.2.0-1 since upstream renamed it. It also carried no wrapdb_version field, so
`meson wrap update` could not tell what it was upgrading from and the bump
script skipped it silently, leaving us stuck on a 2018 release.

Point the wrap at nlohmann/json directly rather than routing through WrapDB,
which is slow to adopt upstream releases. Upstream has shipped a root
meson.build declaring nlohmann_json_dep since 2017, so no packaging overlay is
needed and ui/thirdparty keeps asking for the same dependency name.

The revision stays on v3.2.0 so this is only a change of mechanism. The bump
script can now carry it forward to v3.12.0 on its own.
2026-09-08 04:34:32 -07:00
Matt Borgerson 8816832709 meson: Track SDL3 with a git wrap
sdl3.wrap was a hand-written [wrap-file] pointing straight at upstream release
tarballs. The bump script hands every [wrap-file] to `meson wrap update`, which
needs a wrapdb_version field to work, so SDL3 was silently skipped on every run
and had to be bumped by hand. WrapDB's own sdl3 package trails upstream, so
pointing back at it is not the answer either.

A git wrap goes through the script's existing GitHub path, which already
resolves the newest matching tag and rewrites the revision. SDL tags releases
as release-X.Y.Z, which the default semver pattern does not match, so give the
wrap a tag_regex like glslang and SPIRV-Reflect have.

The release tarball is a git export plus REVISION.txt, so the only build
difference is that SDL's CMakeLists now takes its non-release path for the
revision string it reports.
2026-09-08 04:23:13 -07:00
Matt Borgerson dc5909c2d1 docs: Drop watermark item in agent pre-submission checklist 2026-09-08 04:18:47 -07:00
Erik Abair e4e4ca5d3b docs: Add instructions for autonomous agents 2026-09-07 17:04:49 -07:00
Erik Abair 193a19d92b docs: Add note on comment use 2026-09-07 16:25:22 -07:00
Erik Abair da5ac6a1a1 ci: Run unit tests alongside build 2026-09-07 16:25:00 -07:00
dependabot[bot] 429c9972eb ci: bump softprops/action-gh-release from 3.0.2 to 3.0.3
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/3d0d9888cb7fd7b750713d6e236d1fcb99157228...efb35369e0ad2afab669f228072c1b0d510eae64)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 3.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-06 21:36:28 -07:00
dependabot[bot] 2165625dc8 ci: bump benc-uk/workflow-dispatch from 1.3.2 to 1.3.3
Bumps [benc-uk/workflow-dispatch](https://github.com/benc-uk/workflow-dispatch) from 1.3.2 to 1.3.3.
- [Release notes](https://github.com/benc-uk/workflow-dispatch/releases)
- [Commits](https://github.com/benc-uk/workflow-dispatch/compare/31e2b3319479a63f0ab15bf800eff9e913504e26...d004979be141727c7a17c28f603e2facc40d0855)

---
updated-dependencies:
- dependency-name: benc-uk/workflow-dispatch
  dependency-version: 1.3.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-06 21:36:07 -07:00
Erik Abair 99a8bd3b48 ui: Use DXGI to perform swapping on Windows
In #2691, xemu was updated to decouple the guest vblank interrupt from the host
refresh. This allows the UI thread to run at host FPS while the guest runs at
60 fps, matching HW behavior.

On Window machines using AMD drivers, this led to a major decrease in guest
performance when vsync is enabled, apparently due to locking behavior in the
driver holding the guest pfifo thread while awaiting vblank. This manifests as
reduced perf that gets worse when running at a lower display refresh rate.

This PR bypasses the GL swap entirely, utilizing Windows DXGI to perform swaps
and allowing the pfifo operations to proceed without blocking.

https://github.com/abaire/xemu-perf-tests/blob/4115d262c5e80d6b71234f8df65fa78c8ef15e12/src/tests/surface_rendering_tests.cpp#L167
reproduces the issue seen with Conker L&R (slow glo_readpixels) but it is
somewhat subtle at the given tuning. Modifying this test to perform more draws
per frame will likely produce a more obvious result w/ the pre-PR builds as
there are more opportunities for glReadPixels to stall on main thread vblank waits.
2026-09-06 16:15:06 -07:00
Erik Abair e2c6981737 ui: Load custom controllerdb from config path if set 2026-09-06 16:05:10 -07:00
Erik Abair 86350860e9 ui: Log joystick devices that are not gamecontrollers 2026-09-06 16:05:10 -07:00
Erik Abair 89b53153e5 docs: Add top level contribution guidance 2026-09-06 15:13:02 -07:00
dependabot[bot] f52a0d4e3d ci: bump docker/setup-buildx-action from 4.2.0 to 4.3.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/bb05f3f5519dd87d3ba754cc423b652a5edd6d2c...37fe631027851001ddb9b187196cc803df7f5f0e)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-05 22:57:56 -07:00
Erik Abair d73326b621 nv2a: Implement PTIMER alarm interrupts 2026-08-26 22:40:22 -07:00
Matt Borgerson fc13b78060 apu: Disable DSP JIT by default for first release 2026-08-22 18:41:42 -07:00
Erik Abair 9b5a914fab nv2a/gl: Clear PGRAPH register dirty bitmap when binding shader 2026-08-20 23:03:31 -07:00
dependabot[bot] 298e4edbbd ci: bump astral-sh/setup-uv from 9.0.0 to 10.0.1
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 9.0.0 to 10.0.1.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/c771a70e6277c0a99b617c7a806ffedaca235ff9...20cfd1bf945f4377ade1205e4dbc17946fc9a30d)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-18 01:39:08 -07:00
xemu-robot 8a1e10f0c2 meson: Bump glslang to 16.5.0 2026-08-14 00:13:19 -07:00
xemu-robot 295c13e972 meson: Bump SPIRV-Reflect to vulkan-sdk-1.4.357.0 2026-08-03 01:36:35 -07:00
dependabot[bot] 0ec41d83c7 ci: bump docker/login-action from 4.5.1 to 4.6.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 4.5.1 to 4.6.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/abd2ef45e78c5afb21d64d4ca52ee8550d9572c7...dbcb813823bdd20940b903addbd779551569679f)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-03 01:35:50 -07:00
Stian Eklund cbffb57d08 nv2a/vk: Use nearest for surface<>RAM sync scaling
* nv2a/vk: use NEAREST filter for CPU surface upscale blit

When the CPU uploads surface data at native resolution, the VK renderer
blits it up to the scaled resolution using VK_FILTER_LINEAR for color
surfaces (VK_FILTER_NEAREST for depth). This causes blurring of 2D/UI
content at scale factors > 1.

Switch to VK_FILTER_NEAREST unconditionally to match the GL renderer,
which uses nearest-neighbor pixel replication (surface_copy_expand()).

* nv2a/vk: use NEAREST filter for CPU surface downscale blit

In download_surface_to_buffer, when scaling the GPU surface back down to
guest resolution for CPU readback, use NEAREST rather than LINEAR.

The Xbox never rendered at any internal scale, so VRAM readbacks should
return pixel-exact values rather than host-fabricated averages. LINEAR
was producing blended colors the real hardware never wrote, which breaks
render-to-texture round-trips and any title that reads back VRAM content.

Consistent with the upload path fix which also uses NEAREST.
2026-07-31 19:04:42 -07:00
Reedzit 4d6bfda434 nv2a: Add driver version to shader cache validation 2026-07-27 16:53:47 -07:00