Commit Graph
8 Commits
Author SHA1 Message Date
Joe MattielloandClaude Opus 5.5 5d2ea0b8c5 fix(app): crt-geom and other arrays-of-arrays shader presets on macOS; GLSL at the context's version (#963)
* fix(app): explain and grey out arrays-of-arrays shader presets on macOS

crt-geom failed on macOS with "extension 'GL_ARB_arrays_of_arrays' is not
supported". Its mask code declares 2-D arrays (vec3 slotmask[3][4]).
SPIRV-Cross generates GLSL below 4.30 for such a shader by requiring that
extension unless flatten_multidimensional_arrays is set, and librashader
0.12 never sets that option. macOS stops at OpenGL 4.1 without the
extension, so no GLSL version the app can ask for builds these presets
there.

Rendering all 498 bundled presets on macOS (M4 Max, GL 4.1 Metal) found
15 that fail this way: crt-geom/-deluxe/-tate, crt-hyllian x4, crt-nobody,
crt-super-xbr, vt220, crt-fast-bilateral-super-xbr, img_mod,
test-pattern-append/-prepend and res-independent-scanlines.
presetsNeedingArraysOfArrays() lists them, pinned to the bundled
slang-shaders commit.

- ShaderChain::probeGlCaps() reads the GL version and extensions once
  (from VideoOut::init, and from render()).
- When the context has neither GL 4.3 nor the extension, the preset list
  greys these out with the reason. Choosing one anyway (config.ini, file
  dialog) now shows "it needs OpenGL 4.3 (arrays of arrays); this system
  has OpenGL 4.1" instead of the GL compiler's text. The full error stays
  in lastError().
- shaders_bundled checks that every list entry is a valid bundled preset.
  shaders_gl renders each one and requires a clean, explained failure
  where the capability is missing and a picture where it is present, so
  the list cannot go stale silently. This replaces the crt-geom strstr
  exemption.
- Documented in app/packaging/README.md (macOS notes) and app/README.md.
  app/shaders/README.txt no longer says slang-shaders is not bundled.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): generate shader GLSL at the context's version, not 3.30

The GL chain always asked librashader for GLSL 3.30. A context with more
was still handed 3.30 code, so presets using GLSL 4.00 features
(textureGather with a component, packUnorm4x8, bitCount/findLSB) failed
to build. ShaderChain::probeGlCaps() now records the context's version,
clamped to 330..460, and the chain uses it.

On macOS (M4 Max, GL 4.1 Metal), rendering all 498 bundled presets at 4.10
instead of 3.30 took 462 working presets to 473. lottesRVM, nnedi3 x5,
mmpx-ADV and vectorscale x4 now build and produce a picture, and no preset
that worked stopped working. Linux and Windows contexts will usually get
4.60. No sweep has been run there, and CI does not run shaders_gl on a
real GL context.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-15 01:06:38 -04:00
Joseph MattielloandClaude Opus 5.5 cd5c43fc31 feat(app): say why the shader runtime is unavailable
The Shader section now distinguishes 'not bundled in this build', 'the bundled
runtime is missing' and 'failed to load: <loader reason>' (wrong architecture,
ABI mismatch, missing dependency), and points at the docs for getting a system
copy. Informational only. probeLibrary no longer lets the system loader's
not-found error overwrite the reason a real file failed. Adds a probe test mode
(the app's own lookup, for packaging smoke tests) and VJ_REQUIRE_LIBRASHADER,
which turns a skipped library test into a failure on legs that ship a runtime.

Refs #950

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 19:04:54 -04:00
Joseph MattielloandClaude Sonnet 5.5 0dcea39bbb perf(app): reuse the shader chain's output when the emulated frame has not changed
The chain ran once per UI frame, so a display faster than the core (or a
paused game) re-ran every pass for the same picture, and fed duplicate frames
to history/feedback textures. Output is now keyed on the emulated frame, source
and output size, aspect and fps; params and preset changes invalidate it.

Refs #834

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-13 02:14:22 -04:00
Joseph MattielloandClaude Opus 5.5 86f712880b fix(app): no modal dialog when a librashader candidate is not a loadable DLL; test progress markers
Refs #834

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 22:42:23 -04:00
Joseph MattielloandClaude Opus 5.5 902c8ee907 test(app): bundled-preset GL check tolerates crt-geom on GL 4.1; keep full shader error text
Refs #834

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 22:30:42 -04:00
Joseph MattielloandClaude Opus 5.5 6c99cf93ba feat(app): bundle a pinned libretro/slang-shaders subset (fetched, not committed)
Pinned tarball + SHA256, transitive-closure directory list, extracted
untouched with per-directory licences, copied beside the executable.
Default ON, fail-soft, opt-out flag. Also fixes the MSVC test build
(NOMINMAX) and adds shaders_bundled.

Refs #834

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 22:27:18 -04:00
Joseph MattielloandClaude Opus 5.5 4f8c81d36b feat(app): shader fixes found on real hardware, dev flag, docs
Source texture gets MAX_LEVEL 0 (librashader samples it with mipmapped
filters; without a chain it read as black), output UVs are the plain ones
(verified by reading pixels back), --show-window settings-video, README
section, optional real-checkout parser test.

Refs #834

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 22:14:25 -04:00
Joseph MattielloandClaude Opus 5.5 b2bdb54170 feat(app): librashader shader presets (.slangp) on the GL presenter
Runtime-loaded librashader (headers fetched at configure time, pinned by
SHA256; no Rust in the build), preset validation/discovery, a settings
section with parameters, two first-party presets, and headless tests.
Missing library or a broken preset falls back to the plain picture with a
one-line notice.

Refs #834

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 22:02:02 -04:00