Commit Graph
47402 Commits
Author SHA1 Message Date
Henrik Rydgård 050cacbbdf Merge pull request #22214 from hrydgard/gles-fixes
Claude code review: OpenGL backend
2026-09-04 11:45:42 -06:00
Henrik Rydgård 256984d561 Fix some Claude-isms 2026-09-04 10:41:31 -06:00
Henrik Rydgård ac016201dc GLES: Small cleanups
Scissor the stencil readback to the region actually being read back - latent,
every caller passes a zero origin today.

Remove a DecodeVerts call that can never do anything: both branches above it
have already advanced decodeVertsCounter_ to numDrawVerts_. Worse than useless,
since in the non-skinning branch the vertices went to the push buffer, so
decoded_ doesn't hold them.
2026-09-04 10:41:31 -06:00
Henrik Rydgård 78692deca2 GLES: Set IS_3D when creating the 3D texture, not after uploading it
The out-of-memory bail-out added in the previous commit returned before the
status flag was set, leaving a GL_TEXTURE_3D object bound while ApplyTexture
told the shader generator it was a 2D texture. The entry stays cached, so it
would repeat every frame, not just the one that failed to allocate.
2026-09-04 10:41:31 -06:00
Henrik Rydgård 89ebb8acc6 GLES: Actually apply anisotropic filtering
TextureCacheGLES passed a hardcoded 0.0f instead of key.aniso, so the
Anisotropic Filtering setting did nothing at all on the OpenGL backend, even
though GPU_USE_ANISOTROPY was advertised and D3D11/Vulkan both honor it. Looks
like it was left behind by the 2017 render manager refactor.

The queue runner now clamps to the device maximum it already queried into
maxAnisotropyLevel_ (until now unused), and only touches the parameter when the
extension is actually supported - the anisotropy branch there has been dead
since every caller passed 0.0f, so this is the first time it runs.

0.0f keeps its meaning of "don't care" for the CLUT/fragment-test/thin3d
callers; the texture cache now passes 1.0f when the setting is off, so turning
it off takes effect on already-uploaded textures instead of only new ones.

TexCache: Never use anisotropic filtering for CLUT8-indexed textures

What gets sampled for those is palette indices, depalettized by the shader
afterwards - averaging indices across an anisotropic footprint produces garbage
colors. Affects all backends, not just the GL one that just started honoring
key.aniso.

TexCache: Clear key.aniso wherever filtering is forced to nearest

It was only cleared in the two places inside the AUTO_MAX_QUALITY branch, so the
TEX_FILTER_AUTO path (pixel-mapped textures, the ugly color test heuristic), the
FORCE_NEAREST setting and the replacement-texture override could all end up
requesting nearest filtering with anisotropy still on.

Doing it in the switch that applies forceFiltering covers every path, so it
can't drift apart again.

GLES: Only record the applied anisotropy, and log skipped draws

The queue runner updated tex->anisotropy even when it skipped the call because
the value was 0.0f ("don't care") - harmless while nothing ever set anisotropy,
but now it would make the tracked state disagree with GL, so a later request for
the value it thinks is set would be wrongly skipped.

Also log when a draw is skipped for a missing vertex shader. The failure is
cached per shader ID, so without it geometry silently disappears for the rest of
the session after the one-shot OSD message.
2026-09-04 10:41:15 -06:00
Henrik Rydgård 172cea4b31 Merge pull request #22213 from hrydgard/remove-geometry-shaders
Remove the leftover geometry shader scaffolding
2026-09-04 10:19:46 -06:00
Henrik Rydgård 388eef9d88 GLES: Harden the shader disk cache loader and the 3D texture upload path
The cache loader indexed &vec[0] on vectors that can legitimately be empty (a
header-sized file with zero counts passes both sanity checks), and the counts
are signed ints where only the upper bound was checked - a negative count would
reach resize() as a huge size_t.

The 3D texture branch had the out-of-memory assert but not the bail-out the 2D
branch has, so an ignored assert fell straight into memset(nullptr).
2026-09-03 20:43:06 -06:00
Henrik Rydgård ad131e522f GLES: Handle shader compilation failure in the hardware transform path
ApplyVertexShader can return null - if the requested shader fails to compile it
retries with a software transform ID, and if that fails too it returns (and
caches) null. We then called UseHWTransform() on it.

ApplyFragmentShader can likewise return null, and the hardware path ignored it,
unlike the software path. Without a linked shader nothing binds a program for
this render pass, so the draw would have gone through with whatever program a
previous pass left bound.
2026-09-03 20:43:06 -06:00
Henrik Rydgård 245ed61c0f GLES: Actually apply the stencil write mask in ApplyDrawStateLate
53aa2cc596 changed the first argument from "true" to stencilState_.writeMask,
but that slot is "bool enabled" - the writeMask argument stayed hardcoded to
0xFF, so the mask still never reached GL. The clear-mode call just above gets
the slots right.

Reachable because SoftwareTransformCommon refuses the fast clear path when the
stencil write mask is partial, so exactly those clears end up here.
2026-09-03 20:43:06 -06:00
Henrik Rydgård 8e3a52d782 Merge pull request #22180 from hrydgard/another-adhoc-server
Indonesian adhoc relay server, andexplaystream
2026-09-03 20:40:33 -06:00
Henrik Rydgård 77a93c1dfe Add the Andexplaystream adhoc server
Its data.json works over plain http on port 80, which is why the
earlier attempts to confirm it failed.

Fixes #22164
2026-09-03 20:39:47 -06:00
Henrik Rydgård 9ff58449a8 Merge pull request #22212 from Kethen/add_aemu_postoffice_server_entry
add aemu_postoffice test server to adhoc-servers.json
2026-09-03 20:09:56 -06:00
Katharine Chui 11e226c312 add aemu_postoffice test server to adhoc-servers.json
Test server ran by the https://github.com/Kethen/aemu_postoffice
project
2026-09-04 00:50:18 +02:00
Henrik Rydgård 410939fc5e Merge pull request #22206 from acts-1631/security/fix-startup-service-flags
Use selected flags when starting the web server
2026-09-03 21:22:21 +02:00
Henrik Rydgård bdaf6dcaf4 Merge pull request #22208 from acts-1631/security/fix-cso-index-overflow
Reject overflowing CSO index sizes
2026-09-03 20:36:15 +02:00
Henrik Rydgård de0dc2d7d4 Remove the leftover geometry shader scaffolding
Nothing has generated or used a geometry shader since the GS paths were removed
- GeometryShaderGenerator is gone, and ShaderWriter's BeginGSMain/EndGSMain had
no callers at all. Removes ShaderStage::Geometry and everything hanging off it:
the GS preambles and GSMain helpers in ShaderWriter, the stage mappings in all
three thin3d backends, the D3D11 geometry shader plumbing (curGS_, the pipeline
and module members, gs_4_0 compilation), CreateGeometryShaderD3D11, the unused
PipelineFlags::USES_GEOMETRY_SHADER and PipelineManagerVulkan's
UsesGeometryShader().

Also stop enabling the Vulkan geometryShader device feature, since we no longer
have any use for it.

Kept on purpose: the device feature is still listed in the feature dumps (like
other capabilities we don't use), and the Vulkan shader cache header keeps its
now-always-zero geometry shader count so the on-disk format stays compatible.
2026-09-03 11:24:03 -06:00
Acts1631 095480bcb9 Reject overflowing CSO index sizes
Keep CSO frame and block counts wide until validating their 32-bit

representation, preventing numFrames + 1 from wrapping. Also reject

index tables that cannot fit in the source file or host size_t before

allocation and indexing.
2026-09-03 10:06:35 -04:00
Acts1631 f86e04a7c6 Fix startup web server flag selection
Pass the flags selected from the independent remote sharing and

debugger startup settings instead of enabling every web service.

This keeps remote disc sharing from exposing the unauthenticated

debugger and upload handlers.
2026-09-03 10:05:21 -04:00
Henrik Rydgård 2820fa9467 Have Claude reorganize its own notes, as AGENTS.md was becoming very big. 2026-09-02 16:33:42 -06:00
Henrik Rydgård 6071ab654c Merge pull request #22204 from hrydgard/dbz-fix
FramebufferManager: Correct the logic changes from "Add new TexCache logging channel"
2026-09-03 00:18:38 +02:00
Henrik Rydgård 293cf0c78c Revert the logic changes from "Add new TexCache logging channel"
This partially reverts commit ee1314f803.
2026-09-02 15:56:10 -06:00
Henrik Rydgård 3a6e6e3e0b Merge pull request #22197 from hrydgard/arm64-irjit-sxtw
Fix Arm64 IRJIT sxtw bug with kernel addresses
2026-09-02 21:51:11 +02:00
Henrik Rydgård 6b8d4bc11f Merge pull request #22191 from hrydgard/memarena-and-bounds-fixes
MemArena and bounds fixes
2026-09-02 18:28:46 +02:00
Henrik Rydgård e2768c86a4 Merge pull request #22198 from hrydgard/misc-fixes
Fix Kotcrab's reported issues, fix port slider on remote ISO sharing screen
2026-09-02 18:28:05 +02:00
Henrik Rydgård ef6029cc2e STR_VIEW 2026-09-02 18:15:17 +02:00
Henrik Rydgård d9acafde85 AGENTS.md: spell out when a heredoc mangles a patch script
Git Bash strips one level of backslash escaping even with a quoted delimiter, so a
'\n' meant to land in the output arrives as '\n' and Python writes a real newline
instead. Records both failure signatures - a C2001 for the first, a silently
non-matching anchor for the second - and when to reach for Edit or a script file.

Delete file that shouldn't be there
2026-09-02 18:06:47 +02:00
Henrik Rydgård dcbfa7d3ee Custom buttons: sanitize image/shape on the one screen that didn't
CustomButtonMappingScreen indexes customKeyImages[36] and customKeyShapes[11] with
values read straight from the ini, and it's reachable from the main menu - so
neither GamepadEmu nor TouchControlLayoutScreen, which both sanitize first, need
have run. Those two had the same fixup copy-pasted; hoisted it into a Sanitize()
next to the tables and called it from all three.
2026-09-02 18:06:47 +02:00
Henrik Rydgård 329b7a15bd Don't call std::terminate on a malformed number in argv or compat.ini
CmdLine used std::stoi/std::stod and Compatibility used stoi/stof, all of which
throw on junk with nothing catching them. 'PPSSPPHeadless --timeout=abc' aborted
the process, and so did a bad value in a [PostShaderSetting]-style compat section -
at startup, with no diagnostic. Parse with sscanf and report it: CmdLine already
has the pattern for this in its Bool case, and Config.cpp's ini reads were fixed
the same way earlier. A bad compat.ini entry now warns and keeps the default.
2026-09-02 18:06:47 +02:00
Henrik Rydgård d4b6965db0 TestBoundingBox: bail out when the indices reach past the scratch space
corners and verts are carved out of decoded_ at fixed offsets 6*65536 bytes apart,
and NormalizeVertices fills corners with indexUpperBound - indexLowerBound + 1
SimpleVertex. The vertexCount > 1024 guard doesn't bound that: the index values come
from the game, so 1024 indices can span the full 16-bit range and run corners into
verts, making the cull decision from overwritten data. Bail on an index over 1024
and report visible - a bbox test that large isn't worth doing anyway.
2026-09-02 18:06:47 +02:00
Henrik Rydgård 506cfb6701 Bound two values that texture packs and shader inis supply
A hashrange of 'addr,w,h = 0,0' passed validation (0 isn't bigger than the source),
became desc_.newW/newH, and ReplacedTexture::Prepare divides by them. A post-shader
SSAA level multiplies the render resolution with no upper bound, while the
texture-shader Scale sitting a few lines away is checked against 2..8.
2026-09-02 18:06:47 +02:00
Henrik Rydgård 91f08424fd MemArena: report mapping failures instead of returning success
Horizon's CreateView printed 'Fatal error creating the view' and then returned base
anyway, so the caller recorded an unmapped address as a live view. Posix's
ftruncate failure was logged with a '// Should this be a failure?' - it is: the
mmaps afterwards succeed against a short file and the first touch past its end
raises SIGBUS, which is only hooked under __APPLE__.
2026-09-02 18:06:47 +02:00
Henrik Rydgård 67b4b68005 Comment on a failed UWP view aliasing attempt, document why it can't work 2026-09-02 18:06:47 +02:00
Henrik Rydgård 2d5d2b98a7 Merge pull request #22188 from hrydgard/misc-crash-and-state-fixes
Claude fixing more assorted bugs
2026-09-02 18:03:30 +02:00
Henrik Rydgård 597e2bc6c0 Add a comment about the shared_ptr<atomic> 2026-09-02 17:53:12 +02:00
Henrik Rydgård f0411ff6f4 Cleanup claude's mess with strerror_r 2026-09-02 17:53:12 +02:00
Henrik Rydgård 3ef6ad6285 arm64jit: Don't sign-extend constant addresses with the top bit set
The ARM64 IR JIT crashed on any load/store to a constant address with the
top bit set and an offset too large for an immediate - the kernel RAM mirror
at 0x88000000, for instance.

PrepareSrc1Address is careful about this: a constant address like 0x89100010
arrives sign-extended as a negative int64_t, and the (imm & 0xC0000000) ==
0x80000000 check turns it back into the positive value it should be. But when
the offset doesn't fit an immediate we fall back to loading it into a register
and using the register-offset addressing mode, which only takes the W half of
that register plus an extend - and we asked for SXTW, undoing the fix and
pointing the access ~2GB below the memory view.

Sign extension is still right when the offset is genuinely negative, which
happens when the base is a pointerified register and the displacement is a
negative one from the MIPS instruction. So extend based on the sign of imm.

Found by the Jit unit test, which stores to 0x89100000 and segfaults in the
JIT_IR phase - only reproducible on an actual ARM64 CPU, which is why it never
showed up on CI. The RISC-V and LoongArch backends get this case right already.
2026-09-02 17:53:12 +02:00
Henrik Rydgård d3f99fc454 Remote ISO port: change the increment/decrement interval to 1
Fixes #22196
2026-09-02 17:52:26 +02:00
Henrik Rydgård 6fb7ba7b13 Using the GE debugger before launching a game was a crash. De-claude a bit in Kotcrab's code. 2026-09-02 17:52:26 +02:00
Henrik Rydgård c34f5000ab Merge pull request #22193 from hrydgard/linux-https
Enable HTTPS on Linux, through naett's libcurl backend
2026-09-02 17:42:14 +02:00
Henrik Rydgård a0873e5b0e Enable HTTPS on Linux, through naett's libcurl backend
naett has had a complete libcurl backend all along; we just never built it,
so Linux ran with HTTPS_NOT_AVAILABLE. That means no homebrew store over
HTTPS, and RetroAchievements talking to plain http://retroachievements.org.

libcurl is loaded with dlopen rather than linked, the same way we handle the
Vulkan loader, so it stays a soft dependency: we need the curl headers at
build time, but a build made here still starts on a machine without libcurl
installed - it just reports HTTPS as unavailable, exactly like today. Distro
packagers get the behavior they'd expect either way, and certificate
validation comes free from the system CA store.

New net::HTTPSAvailable() answers "did that work", and SDLMain folds it into
SYSPROP_SUPPORTS_HTTPS, which everything downstream already degrades on.

Four fixes to the backend itself, all noted in ext/naett/README-ppsspp.md:

- panic() called exit(1) on a pipe or curl_multi_perform failure. Taking the
  emulator down because a download failed isn't acceptable - the backend now
  disables itself and requests complete with naettGenericError.
- CURLINFO_RESPONSE_CODE writes a long into res->code, which is an int. Eight
  bytes into four, getting away with it only because the next field absorbs
  the zeroes.
- curl_easy_setopt is varargs and wants a long for these options; int literals
  and int variables are UB on LP64.
- naettPlatformCloseResponse called through a null function pointer when
  libcurl was missing. Found by testing that path, which segfaulted.

CI needs libcurl4-openssl-dev (curl-dev on Alpine) or it would quietly keep
building without HTTPS.
2026-09-02 17:42:04 +02:00
Henrik Rydgård 603faf9c19 Merge pull request #22195 from hrydgard/dependabot/github_actions/softprops/action-gh-release-3.0.3
Bump softprops/action-gh-release from 3.0.2 to 3.0.3
2026-09-02 17:35:45 +02:00
Henrik Rydgård 5aa453fbd6 Merge pull request #22194 from hrydgard/dependabot/github_actions/actions/setup-java-6.0.0
Bump actions/setup-java from 5.6.0 to 6.0.0
2026-09-02 17:35:45 +02:00
dependabot[bot] 0fea6b743b 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-02 17:35:20 +02:00
Henrik Rydgård ec830432d1 Merge pull request #22192 from hrydgard/vendor-naett
Include the naett library in-tree
2026-09-02 17:35:20 +02:00
dependabot[bot] eb457f3e2e Bump actions/setup-java from 5.6.0 to 6.0.0
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.6.0 to 6.0.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v5.6.0...v6.0.0)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-02 17:35:20 +02:00
Henrik Rydgård 2096df52f5 Vendor naett in-tree, de-amalgamated
naett has been a submodule pinned at v0.3.3; upstream has had no commits since
April 2024, and we want to carry local changes (next up: a libcurl-backed HTTPS
path for Linux). It's ~1500 lines of MIT C, smaller than several things we
already vendor, so bring it in-tree and drop the submodule.

Also drop the generated single-file amalgam (naett.c) that every build system
was compiling, and build src/*.c directly instead - otherwise the file you edit
isn't the file that gets compiled, which is a trap for anyone patching this.
example/ and testrig/ (a whole Android Studio project) are gone with it.

Two changes were needed to make the sources build on their own, both noted in
ext/naett/README-ppsspp.md along with the upstream commit:

- naett_internal.h now includes naett.h, which the amalgam pulled in first.
- naett_linux.c now includes stdio.h/stdlib.h. It calls exit/calloc/realloc/
  free/fprintf without ever including either, and only got away with it because
  naett_core.c sat above it in the concatenation.

No functional change - Linux still has HTTPS_NOT_AVAILABLE set, so it doesn't
build naett at all yet.

Rename naett to naett-lib
2026-09-02 17:35:14 +02:00
Henrik Rydgård 56bba5f6f5 Merge pull request #22189 from hrydgard/debug-input-rewind-overflows
Fix three more out-of-bounds writes (minor)
2026-08-31 17:53:10 +02:00
Henrik Rydgård a4082bede6 Bump gradle to 9.7.1 2026-08-31 16:37:56 +02:00
Henrik Rydgård 14111097da Claude found this code buggy, and it's not used, so delete it. 2026-08-31 16:37:55 +02:00
Henrik Rydgård 9cb50459d6 Merge pull request #22186 from hrydgard/medium-correctness-fixes
Medium-severity correctness fixes
2026-08-31 16:30:53 +02:00