Commit graph

1745 commits

Author SHA1 Message Date
Wunkolo
32331f9068 renderer_gl: Implement multisample Convert{DS24S8ToRGBA8,RGBA4ToRGB5A1} 2026-05-09 23:24:38 -07:00
Wunkolo
4f5fd843ea renderer_gl: Fix surface ScaleUp implementation
Should assign the new `res_scale` and `sample_count`
2026-05-09 22:39:12 -07:00
Wunkolo
f956d4befc renderer_gl: Initial MSAA implementation
Basically copied over some of the paradigms over from Vulkan. Covers most rendering uses-cases except for conversions such as `ConvertDS24S8ToRGBA8` and `ConvertRGBA4ToRGB5A1`
2026-05-09 20:30:11 -07:00
Wunkolo
bde992baae config: Refactor sample_count to antialiasing setting
Intended to allow for other anti-aliasing methods to be introduced
2026-05-09 20:30:11 -07:00
Wunkolo
8270f0301f renderer_vulkan: Fix Multisample ConvertDS24S8ToRGBA8
Migrate `ResolveTexture` to `BlitHelper`.
If the conversion was multi-sample, do a final resolve at the end of the conversion to ensure the non-multisample textures are updated as well.

Fixes Pokemon!
2026-05-09 20:30:11 -07:00
Wunkolo
468132fb6a renderer_vulkan: Fix MSAA image debug name 2026-05-09 20:30:11 -07:00
Wunkolo
061ea85ba2 renderer_vulkan: Fix multisample framebuffer creation
MSAA renderpasses require the "current" image as the main resolve target, and the MSAA image as the second attachment.
2026-05-09 20:30:11 -07:00
Wunkolo
f233eb522c renderer_vulkan: Fix multisample ClearTextureWithRenderpass
Ensure that the multisample framebuffer is used rather than the usual one when using a render pass to clear the textures.

That way, a MSAA-render AND resolve is used to clear the textures at the same time.
2026-05-09 20:30:11 -07:00
Wunkolo
3593a15046 renderer_vulkan: Fix ConvertDS24S8ToRGBA8 image targets
Ensure that the Multi-Sample texture is used for the destination color image as well. Should the dest image be MSAA too? Or should all the values be resolved into a minimum depth and some combination of stencil-values here?
2026-05-09 20:30:11 -07:00
Wunkolo
9f2f938b7e renderer_vulkan: Fix Surface::ScaleUp scale/sample increase
This should be checking the _new_ value to possibly cull upscaled texture creation rather than the current value of the surface. Fixes broken up render passes when drawing UI in some games.
2026-05-09 20:30:11 -07:00
Wunkolo
dae801da2d renderer_vulkan: Fix MSAA framebuffer target resolve surface
Use the specified type rather than defaulting to the surface's current one(implicit `ImageView` argument).
2026-05-09 20:30:11 -07:00
Wunkolo
55c4e15ceb renderer_vulkan: Fix narrowing byte conversion
Fixes a compilation error on Unix platforms.
2026-05-09 20:30:11 -07:00
Wunkolo
393cc1053b renderer_vulkan: Add TextureRuntime::ResolveTexture
Rather than use a big lambda, just rip this out into a proper function for other blit functions to utilize.
2026-05-09 20:30:11 -07:00
Wunkolo
5e016a42b1 renderer_vulkan: Fix cleanup and debug-naming for d24s8_to_rgba8_ms_comp 2026-05-09 20:30:11 -07:00
Wunkolo
936a6b7cae renderer_vulkan: Fix initialization of image handles
Try to optimally create the new image handles when a change in res scale or sample-count has actually occured. MSAA images need to be updated too in the case that the resolution scale has changed
2026-05-09 20:30:11 -07:00
Wunkolo
f71044da4f renderer_vulkan: Derive framebuffer sample-count from attachments
Derive the framebuffer sample-count from the input color and depth operands. Similar to how `res_scale` is determined.
2026-05-09 20:30:11 -07:00
Wunkolo
e506c50d8b renderer_vulkan: Fix dangling surface reference during msaa resolve
These individual parameters need to be copied as the reference to the surface-object only lasts within the scope of this function.
2026-05-09 20:30:11 -07:00
Wunkolo
4c859d6570 renderer_vulkan: Fix Framebuffer::sample_count move-operator
`sample_count` needs to be move/copied over.

Also reorder the accessor order to match the declaration of variables.
2026-05-09 20:30:10 -07:00
Wunkolo
4f0a9aac8d renderer_vulkan: Fix multisample texture init barrier
Should address the MultiSampled image directly since the multisampled image is just a transient image and not the leading state of the image.
2026-05-09 20:30:10 -07:00
Wunkolo
94e782ad2c renderer_vulkan: Implement multisample texture runtime
This seems to be enough for simple programs to render with MSAA enabled!
2026-05-09 20:30:10 -07:00
Wunkolo
50e011d54a renderer_vulkan: Implement multisample pipeline/renderpass support
Allows multi-sample render passes and graphics pipelines to be created, using sample-rate shading rather than coverage-based MSAA.
2026-05-09 20:30:10 -07:00
Wunkolo
3950985c59 rasterizer_cache: Initial support for multi-sample surfaces 2026-05-09 20:30:10 -07:00
Wunkolo
57b82a9d66 vk_instance: Add detection of MSAA features
Full multi-sample support is when renderpass-2 and depth-stencil-resolve extensions are available and when sample-rate-shading and msaa-storage-images are supported.
2026-05-09 20:30:10 -07:00
Wunkolo
ad82b2ca76 vk_blit_helper: Add d24s8_to_rgba8_ms_comp
Helper host-shader for blitting multi-sampled DS24S8 textures to multi-sampled RGBA8
2026-05-09 20:30:10 -07:00
Wunkolo
dabbf7c1a6 config: Add sample_count renderer option
Option is only enabled when the renderer is set to Vulkan, for now.
2026-05-09 20:30:10 -07:00
OpenSauce04
dbe7fd979f cmake: Add EXCLUDE_FROM_ALL to targets where applicable 2026-05-09 14:01:56 +01:00
PabloMK7
5ddbaeae23
gsp: Fix GPU interrupt queue and add GPU timing emulation (#2095)
Some checks are pending
citra-build / source (push) Waiting to run
citra-build / linux-x86_64 (appimage) (push) Waiting to run
citra-build / linux-x86_64 (appimage-wayland) (push) Waiting to run
citra-build / linux-x86_64 (gcc-nopch) (push) Waiting to run
citra-build / linux-arm64 (clang) (push) Waiting to run
citra-build / linux-arm64 (gcc-nopch) (push) Waiting to run
citra-build / macos (push) Waiting to run
citra-build / windows (msvc) (push) Waiting to run
citra-build / windows (msys2) (push) Waiting to run
citra-build / android (googleplay) (push) Waiting to run
citra-build / android (vanilla) (push) Waiting to run
citra-build / docker (push) Waiting to run
citra-format / clang-format (push) Waiting to run
citra-libretro / android (push) Waiting to run
citra-libretro / linux (push) Waiting to run
citra-libretro / windows (push) Waiting to run
citra-libretro / macos (arm64) (push) Waiting to run
citra-libretro / macos (x86_64) (push) Waiting to run
citra-libretro / ios (push) Waiting to run
citra-libretro / tvos (push) Waiting to run
citra-transifex / transifex (push) Waiting to run
2026-05-07 01:36:21 +02:00
Wunk
91128d6625
shader_jit: Emit LG2/EX2 subroutines on-demand (#2046)
Some checks are pending
citra-build / source (push) Waiting to run
citra-build / linux-x86_64 (appimage) (push) Waiting to run
citra-build / linux-x86_64 (appimage-wayland) (push) Waiting to run
citra-build / linux-x86_64 (gcc-nopch) (push) Waiting to run
citra-build / linux-arm64 (clang) (push) Waiting to run
citra-build / linux-arm64 (gcc-nopch) (push) Waiting to run
citra-build / macos (push) Waiting to run
citra-build / windows (msvc) (push) Waiting to run
citra-build / windows (msys2) (push) Waiting to run
citra-build / android (googleplay) (push) Waiting to run
citra-build / android (vanilla) (push) Waiting to run
citra-build / docker (push) Waiting to run
citra-format / clang-format (push) Waiting to run
citra-libretro / android (push) Waiting to run
citra-libretro / linux (push) Waiting to run
citra-libretro / windows (push) Waiting to run
citra-libretro / macos (arm64) (push) Waiting to run
citra-libretro / macos (x86_64) (push) Waiting to run
citra-libretro / ios (push) Waiting to run
citra-libretro / tvos (push) Waiting to run
citra-transifex / transifex (push) Waiting to run
Rather than emitting these subroutine functions for _every_ shader, only emit
the subroutines when the `LG2` and `EX2` instructions are actually used.
This saves a good chunk of memory across all shaders.

Inspired by Tanuki3DS.
2026-04-24 20:34:46 +02:00
PabloMK7
0fe6a8c7df
video_core: Properly handle non RGBA8 shadow textures (#2047)
Some checks failed
citra-build / source (push) Has been cancelled
citra-build / linux-x86_64 (appimage) (push) Has been cancelled
citra-build / linux-x86_64 (appimage-wayland) (push) Has been cancelled
citra-build / linux-x86_64 (gcc-nopch) (push) Has been cancelled
citra-build / linux-arm64 (clang) (push) Has been cancelled
citra-build / linux-arm64 (gcc-nopch) (push) Has been cancelled
citra-build / macos (push) Has been cancelled
citra-build / windows (msvc) (push) Has been cancelled
citra-build / windows (msys2) (push) Has been cancelled
citra-build / android (googleplay) (push) Has been cancelled
citra-build / android (vanilla) (push) Has been cancelled
citra-build / docker (push) Has been cancelled
citra-format / clang-format (push) Has been cancelled
citra-libretro / android (push) Has been cancelled
citra-libretro / linux (push) Has been cancelled
citra-libretro / windows (push) Has been cancelled
citra-libretro / macos (arm64) (push) Has been cancelled
citra-libretro / macos (x86_64) (push) Has been cancelled
citra-libretro / ios (push) Has been cancelled
citra-libretro / tvos (push) Has been cancelled
citra-transifex / transifex (push) Has been cancelled
2026-04-17 21:45:50 +02:00
PabloMK7
f1cd5f5ff4
video_core: fix color blend min/max mode in OpenGL (#2038)
* video_core: fix check for fragment color blend emulation

* video_core: Fix typo in gl fragment shader gen
2026-04-14 19:26:22 +02:00
Eric Warmenhoven
e8c75b4107
libretro: vulkan: wait before ticking (#2004)
Some checks are pending
citra-build / source (push) Waiting to run
citra-build / linux-x86_64 (appimage) (push) Waiting to run
citra-build / linux-x86_64 (appimage-wayland) (push) Waiting to run
citra-build / linux-x86_64 (gcc-nopch) (push) Waiting to run
citra-build / linux-arm64 (clang) (push) Waiting to run
citra-build / linux-arm64 (gcc-nopch) (push) Waiting to run
citra-build / macos (push) Waiting to run
citra-build / windows (msvc) (push) Waiting to run
citra-build / windows (msys2) (push) Waiting to run
citra-build / android (googleplay) (push) Waiting to run
citra-build / android (vanilla) (push) Waiting to run
citra-build / docker (push) Waiting to run
citra-format / clang-format (push) Waiting to run
citra-libretro / android (push) Waiting to run
citra-libretro / linux (push) Waiting to run
citra-libretro / windows (push) Waiting to run
citra-libretro / macos (arm64) (push) Waiting to run
citra-libretro / macos (x86_64) (push) Waiting to run
citra-libretro / ios (push) Waiting to run
citra-libretro / tvos (push) Waiting to run
citra-transifex / transifex (push) Waiting to run
Ensure the scheduler worker thread has finished processing all dispatched command chunks before the rasterizer cache's garbage collector destroys sentenced surfaces.
2026-04-11 22:56:09 +02:00
Wunkolo
4cbd75b413 shader_jit: Optimize GeometryEmitter SETEMIT state
The `SETEMIT`/`SETE` instruction only actually encodes 4 bits of possible state,
but this is currently expanded into three separate bytes of
data(four with padding) and requires three separate byte-writes for the x64 and
a64 JITs to write into. These 4 bits from the instruction can instead be
compacted into a singular 1-byte write from the JIT by encoding these 4 bits of
state into a singular byte at JIT-time, and unpacking this data is instead done
by `GeometryEmitter::Emit`. This also allows the serializer to use a singular
byte for all 3 fields now as well.
2026-04-05 23:02:56 +02:00
OpenSauce04
23393904e0 Fixed NetBSD build issues
- Added missing include
- Fixed X11 include directory not being included
2026-04-05 13:11:40 +01:00
PabloMK7
7e58ac5bcf android: Handle surface lost during swapchain creation 2026-03-27 18:31:13 +00:00
OpenSauce04
6715959382 shader_jit_a64_compiler: Added missing include
Fixes a build issue on ARM64 Linux w/ GCC

Fix proposed by PabloMK7
2026-03-12 17:18:29 +00:00
PabloMK7
a3db3be4a6
video_core: vulkan: Fix Framebuffer move behaviour (#1865) 2026-03-11 23:36:03 +01:00
Eric Warmenhoven
3a5fa35449 libretro: draw cursor in vulkan 2026-03-08 19:04:10 +00:00
PabloMK7
8d284aeccf
video_core: Fix a few vulkan validation issues (#1818) 2026-03-04 21:05:22 +01:00
PabloMK7
0f9d5f29f3
video_core: Move shader and pipeline compilation into separate workers (#1802) 2026-03-01 23:09:13 +01:00
PabloMK7
7d19679cc5
video_core: vk_texture_runtime: Refactor and fix resource leak (#1790) 2026-02-25 19:53:03 +01:00
PabloMK7
b3fd0b6c89
video_core: Apply texture filter to color surfaces (#1784) 2026-02-25 13:08:18 +01:00
Eric Warmenhoven
fe59958b63 older tvos hardware does not support layered rendering 2026-02-23 22:49:02 +00:00
PabloMK7
8b72dcb235
video_core: Do not spam file IO when reading vulkan shader disk cache (#1774) 2026-02-23 15:45:26 +01:00
PabloMK7
4c054ff2e7
video_core: Fix transferability issue in vulkan shader disk cache (#1770) 2026-02-22 22:41:24 +01:00
jbm11208
1092295f2a
Fix Shadow Rendering / Texture Filtering (#1675)
* video_core/renderer_vulkan: Add texture filtering

* Fix Shadow Rendering (again...)

* Make individual image views per res scale

* Refactor texture runtime

* Fix some magic numbers

* More fixes and filter pipeline cache.

* Refactor Surface and Handle move and destructor

---------

Co-authored-by: PabloMK7 <hackyglitch2@gmail.com>
2026-02-20 23:39:04 +01:00
Eric Warmenhoven
d9b77cc21e
Implement libretro core (#1215)
* libretro core

* Bringing citra libretro implementation over
* libretro: hook up vulkan renderer
* libretro: github actions
* libretro: gyro
* libretro: core options v2
* libretro: on ios turn off shader jit if unavailable
* moltenvk 1.3.0 introduces 8-bit indexes but allocates 16-bit for metal; this ends up allocating stream buffer * 2 = 132MiB. Instead, just use 16-bit indexes. (This will be necessary for standalone when bumping moltenvk version.)

* libretro core: address review feedback

* libretro: microphone support

* cmake: Add ENABLE_ROOM_STANDALONE to list of incompatible libretro flags

* libretro: proper initial geometry

* libretro: fix software renderer

* libretro: address review feedback

* .github/libretro.yml: Pin macOS runners at macOS 26

* ci: Remove explicit selection of Xcode 16.0

* .github/libretro.yml: remove unnecessary windows builder apt commands

* .github/libretro.yml: bump min macos version to 11.0

* ci: Re-enable CI jobs for all libretro cores

This is under the condition that we don't introduce build cache for these builds

---------

Co-authored-by: OpenSauce04 <opensauce04@gmail.com>
Co-authored-by: PabloMK7 <hackyglitch2@gmail.com>
2026-02-19 22:30:25 +00:00
PabloMK7
c43f24e489
video_core: Fixes to vulkan disk cache (#1748) 2026-02-17 14:22:48 +01:00
PabloMK7
304db9173b
video_core: vulkan: Add disk shader cache (#1725) 2026-02-16 15:59:22 +01:00
OpenSauce04
0c478d7614 Add "Enable display refresh rate detection" setting on desktop 2026-02-09 20:08:34 +00:00
PabloMK7
f010863ece
video_core: vulkan: Only store hashes in shader cache maps (#1710) 2026-02-02 18:25:03 +01:00