When FindBindlessEntry already returns a valid entry matching (addr,
count, image_table_generation), the TIC descriptor table has not been
invalidated since the last population. In that case we can skip the
ReadBlockUnsafe + memcmp entirely and replay the cached views/samplers
directly.
WARNING: This assumes that games do not write new texture handles to the
cbuf without also triggering a TIC table invalidation (generation bump).
If that assumption is wrong for a specific game, stale textures may
appear. Revert this commit independently to isolate any regressions.
Applies to both graphics and compute pipelines.
Fix texture corruption caused by the shader compiler treating unknown
constant buffer sizes as 0 instead of the bindless array length:
- Set BINDLESS_FALLBACK_LENGTH = BINDLESS_ARRAY_LENGTH (1024) in
texture_pass.cpp so shaders always allocate the full descriptor range
- Pre-capture cbuf sizes in GraphicsEnvironment/ComputeEnvironment
constructors and serialize them through FileEnvironment to prevent
intermittent 0-size reads from async worker threads
- Bump CACHE_VERSION to 14 to force one-time recompile of existing
shader caches with the corrected metadata
- Reduce MAX_IMAGE_ELEMENTS from 16384 to 1024 to eliminate TLS
pressure caused by the oversized per-thread descriptor array
Add BindlessCache (64 entries, round-robin eviction) keyed on
(cbuf_addr, count, image_table_generation) to skip redundant GPU memory
reads across draws:
- Track image_table_generation in each cache entry; a generation mismatch
forces a full re-read and re-resolve, a match replays cached views
- Mark resolved ImageViewInOuts with id_cached so FillImageViews can
skip VisitImageView for already-resolved entries
- Add GraphicsImageTableGeneration() / ComputeImageTableGeneration()
accessors to DescriptorTable and expose them from TextureCache
Deduplicate PrepareImageView calls for cached bindless entries:
- On a cache hit, FillImageViews was calling PrepareImageView once per
descriptor slot (up to 1024 calls/draw). Replace with a batch pass
that collects unique ImageIds from id_cached views, deduplicates via
sort+unique, then calls PrepareImage once per unique image (~10-50x
fewer calls in practice)
* video_core/vulkan: cache bindless cbuf snapshots to skip per-draw rewalk
Signed-off-by: Mythrax <mythrax@mytrax-rs.org>
* video_core/vulkan: split descriptors so uniforms keep push descriptor path
Signed-off-by: Mythrax <mythrax@mytrax-rs.org>
* Increase from 6 to 32 for proper Async rendering
* Update sdl_driver.cpp
Not sure why stuff was inverted for PlayStation & Xbox controllers, didn't read the commit thoroughly enough. This is a Nintendo Switch emulator, the buttons were perfectly fine already.
* fix: Crash issue related to Linked
* fix: remove unused vendor check
* mmm fuck you SDL
* fix: wrap unused functions for macOS CI
* fix: mk8d applet
This will completely fix the problem with the Mario Kart 8 Deluxe controller applet and other games that use it.
The current solution is missing just one small detail to be perfect.
Signed-off-by: lizzie <lizzie@eden-emu.dev>
* fix: Add Dummy Thread so spinning/deadlock doesn't occur
* video_core/vulkan: cache committed descriptor sets per command buffer
Signed-off-by: Mythrax <mythrax@mytrax-rs.org>
* video_core/vulkan: swap descriptor scratch arrays to small_vector
Mirrors lizbeth's eden change: the std::array<T, 16384> form sized the
spans passed to FillImageViews and CheckFeedbackLoop to the full 16K
capacity instead of the actual write count, inflating per-draw CPU cost
on bindless-heavy shaders.
Reference: https://github.com/citron-neo/emulator/commit/f91f15abd6ffbc5e678617429002f7c56ac8bda9
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Signed-off-by: Mythrax <mythrax@mythrax-rs.org>
Signed-off-by: Mythrax <mythrax@mytrax-rs.org>
---------
Signed-off-by: Mythrax <mythrax@mytrax-rs.org>
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Signed-off-by: Mythrax <mythrax@mythrax-rs.org>
Co-authored-by: Mythrax <mythrax@mytrax-rs.org>
Co-authored-by: CollectingW <217662237+CollectingW@users.noreply.github.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
building with musl fails with:
```
citron-neo/src/core/core.cpp:504:13: error: use of undeclared identifier 'malloc_trim'
504 | malloc_trim(0);
| ^~~~~~~~~~~
1 error generated.
```
change guard from 'not on Android' to 'only with glibc'.
fix: #195
Signed-off-by: Pepper Gray <hello@peppergray.xyz>