Commit Graph

698 Commits

Author SHA1 Message Date
bomabomabomaboma
fbd620c22b [GPU] Implement ZPD occlusion queries
Implements EVENT_WRITE_ZPD handling across shared CommandProcessor, D3D12, and Vulkan backends.

This adds a shared report lifecycle. Reports can span submissions/render passes, split into multiple segments, and asynchronously retire. Reports can also survive same-slot reuse, which is critical for titles that aggressively recycle against a small pool.

RTV/FBO use their respective host occlusion queries, whereas ROV/FSI use counter buffers instead, with shader helpers that are called from the translated PS, accumulating surviving MSAA sample coverage into active slots. Regardless of approach, results are copied to small, dedicated readbacks and fed through shared retirement.

Fast mode writes speculative values and patches in resolved results later. Strict mode waits for real results with a small retire backstop so it doesn't spin forever when a report gets weird. Fake mode's fundamentals are unchanged, it just now uses XenosZPDReport memory helpers like all the modes do.

Also adds optional sample count saturation for instances when attenuation isn't a one-for-one with real hardware, an optional alternate fast behavior that preserves cached zeroes (that can improve flare-heavy titles but might regress occlusion culling), and normalization for upscaling.

QueryBatch is still unsupported other than a fake path that's enabled when a range is set via cvar.
2026-05-30 19:26:25 +02:00
Gliniak
99ea6da18a [XConfig] Implementation of XConfig 2026-05-19 07:50:16 +02:00
Gliniak
74f34818e7 [Lint] Added InsertBraces to linter to unify codebase to one standard 2026-05-08 18:54:50 +02:00
Herman S.
c261027225 [UI] Fix leaked locked_achievement_icon_ texture on drawer teardown
Reset locked_achievement_icon_ alongside font_texture_ and
notification_icon_textures_ when the immediate drawer is cleared,
preventing a debug assertion in D3D12ImmediateDrawer's destructor.
2026-04-13 12:19:56 +09:00
Herman S.
80c6751b82 [UI] Eliminate mouse requirement for initial profile create dialogs
Enable keyboard navigation and accept Enter to complete profile creation
2026-04-13 08:16:05 +09:00
Herman S.
a8ef7faeae [Build/macOS] Exclude empty translation units and Vulkan/SPIR-V targets 2026-03-27 16:12:08 +09:00
Herman S.
cb12f7fa1e [Build] Generalize POSIX platform guards
Most non-Windows code paths use standard POSIX APIs (sockets, signals,
dlopen, threading) that work on any POSIX platform. Change Linux-specific
guards to !WIN32 or #else where the code is portable. Linux-specific
APIs (SIGRTMIN, Vulkan/X11, fontconfig/GTK) remain Linux-guarded.
2026-03-26 23:10:47 +09:00
Herman S.
883c2030d0 [ARM64] Initial commit for arm64 backend
Based entirely off existing xbyak x86 implementation and available
tests. Still needs a lot of optimization and testing on non-Windows
platforms.

So far passes all tests and boots at least some games on Windows.
2026-03-22 15:57:37 +09:00
Herman S.
1e8f1837cf [Build] Use CMAKE_BINARY_DIR for output paths and version.h include
version.h is now found via CMAKE_BINARY_DIR on the include path instead
of a hardcoded "build/version.h" path. This allows out-of-tree and
multi-config builds to each generate and find their own version header
without colliding.
2026-03-21 01:30:31 +09:00
Gliniak
dfd450fcbb [UI] Slightly improved performance of on screen notifications and achievements 2026-03-15 00:08:29 +01:00
Gliniak
d37c22aad0 [HID] Redesigned support for Portals
- Added hotplug support on Windows
- Added support for XamInputNonControllerGetRawEx & XamInputNonControllerSetRawEx
2026-03-14 23:01:38 +01:00
Herman S.
64e51c544e [GPU] Add vulkan shader disk storage / startup loading
Big refactor of the shader storage to allow both backends to share code
2026-03-10 00:49:56 +09:00
Herman S.
5845f3437b [GPU] Async shader compilation for D3D12 and Vulkan
Adds async_shader_compilation cvar (default true) that forces new
pipelines to be created async from the main thread, skips draws entirely
on D3D12 and on vulkan replaces pixel shader with placeholder until the
real one is ready. Causes some visual artifacts on first load but
greatly reduces load times and stutter.
2026-03-10 00:24:26 +09:00
Herman S.
9a704bff1e Fix menu hotkeys on Linux 2026-03-09 09:41:47 +09:00
Herman S.
65d42843b6 Merge remote-tracking branch 'xenia-master/master' into canary_experimental 2026-03-06 23:05:24 +09:00
Herman S.
4bd93883ac [Build] Convert buildshaders to custom build rules 2026-03-04 20:57:42 +09:00
Herman S.
71c5702ee8 [Build] Convert build system to raw cmake and remove premake layer 2026-03-04 17:37:36 +09:00
Herman S.
f2ac39cfd9 [Build] Generate shaders on build instead of having them checked in 2026-03-03 16:21:30 +09:00
Adrian
b1aa0de766 [UI] Extend ImGUI glyph ranges 2026-02-27 21:23:51 +01:00
Herman S.
e7941b0c7d [GPU] 3d-to-2d textures default enable
Replaced the modal cvar with bool gpu_3d_to_2d_texture with "mode 2" now enabled by
default and "mode 1" removed as unnecessary
2026-02-26 14:22:46 +09:00
Herman S.
90c48e1d21 [GPU] 3d-to-d2 texture implementation
Adds vulkan version of mode 1 and 2 and fixes related crashes by keeping
the 2d texture views from the texture cache.
2026-02-26 14:22:46 +09:00
Herman S.
aaf284a4b0 [Vulkan] Fix fullscreen corrupting HDR state on Windows 2026-02-25 12:31:18 +09:00
Herman S.
223aa70171 [Vulkan] Add semaphor reuse workaround and cvar 2026-02-25 12:31:18 +09:00
Herman S.
d505b6b53a [Vulkan] Create per-swapchain-image present semaphores
Fixes vulkan validation issues.
2026-02-25 12:31:18 +09:00
Herman S.
bf880fde0c [Vulkan] Fix alignment related validation errors 2026-02-25 12:31:18 +09:00
Adrian
8d5565da8a [Misc] Fixed missing guard header (#887) 2026-02-23 17:07:23 +09:00
Triang3l
80dad41454 [GPU/WGF] Use ByteAddressBuffer in precompiled shaders
Drivers and hardware may provide more optimal paths for untyped buffers
compared to typed.

Also, ByteAddressBuffer may be bound via a root descriptor in Direct3D 12,
greatly simplifying the binding logic.

ByteAddressBuffer also doesn't have the 128 * 2^20 element count limit that
typed and structured buffers have, and doesn't require the structure stride
to be specified at resource creation time in Direct3D 11.
2026-02-17 23:28:42 +03:00
Herman S.
0b7abf0241 [Vulkan] Add resolution scaling mips support 2026-02-17 21:46:50 +09:00
Herman S.
2ad412a141 [Vulkan] Add support for vkPipelineCache 2026-02-17 21:21:56 +09:00
Herman S.
434644c301 Merge commit 'f2fabfdf0' into canary_experimental
Sync changes from master up to before the recent GPU changes, those will be
merged later
2026-02-17 16:59:38 +09:00
Herman S.
20b226dbdf [Vulkan] Update glslang to 16.0.0 and introduce compat layer 2026-02-17 15:34:23 +09:00
Adrian
abaa0e4c96 [XBDM] Implemented DmGetConsoleType 2026-02-16 21:33:13 +01:00
Herman S.
f9d4dbc8e9 [Build] Use clang 20 for clang format consistently across Win/Lin 2026-02-15 01:25:43 +09:00
Adrian
56cff3a09a [APP] Include title information in Win32 exception dialog 2026-02-08 17:52:21 +01:00
Triang3l
c4e1242fa2 [D3D12] Include recent D3D12 headers from the Microsoft GitHub 2026-01-14 23:05:08 +03:00
Adrian
b723d6e7c2 [UI] Free image data from stbi_load 2026-01-05 19:25:18 +01:00
Triang3l
cbbaae8ead [Vulkan] Recompile internal shaders with Vulkan SDK 1.4.335.0
spirv-remap was replaced with spirv-opt --canonicalize-ids, and debug
information is preserved now.
2026-01-04 17:03:37 +03:00
Adrian
f8fb490ef8 [APP] Disable toggle fullscreen double click while rendering dialogs 2025-12-26 21:50:41 +01:00
Triang3l
dfa1b3fae1 [Vulkan] Clamp device API version to one Xenia was tested on
Fixes the assertion failure in the Vulkan Memory Allocator library when a
driver for a new API version is released, but VMA hasn't been updated yet.
2025-12-14 22:59:35 +03:00
Triang3l
fe1fd36137 [D3D12/Vulkan] Simplify host GPU fence management
Replace the `SubmissionTracker`s with new `GPUCompletionTimeline`s with a
more unified interface (using a base class), and without the internal logic
for queue ownership transfers since that idea was scrapped during the
development of the `Presenter`.

Also use this fence management logic for GPU emulation, though without
architectural reworks for now, just on the bottom level.

Still very messy, but can be cleaned up in further GPU command processor
and presenter reworks.
2025-12-14 21:24:38 +03:00
yippeeeyay
2b77c4c08a [D3D12] Simplify Intel Arc GPU checking 2025-12-07 19:09:36 +01:00
Gliniak
038b11a537 [GPU] Removed nvapi
- According to reports d3d12_nvapi_use_driver_heap_priorities give no benefit
2025-12-05 21:54:06 +01:00
Twig6943
0e51e33b83 Allow user to use wayland backend of gdk
Users can set GDK_BACKEND by themselves which will override the default x11 value
2025-11-09 14:40:05 +01:00
Gliniak
3252d256ca [Emulator] Removed windows rdrand ntdll patch 2025-11-03 20:10:36 +01:00
Adrian
299ba08983 [APP] Detect PR builds with XE_BUILD_IS_PR 2025-10-30 08:19:28 +01:00
Adrian
a1a33b9939 [UI] Set ImGUI clipboard functions to GTK implementations 2025-10-18 21:41:27 +02:00
Gliniak
e27b1d1cb5 [UI] Fixed issues with ImGui on Vulkan and few ASAN issues related to ImGui
- Simplified handling of notifications to faster version with ranges
- Removed usage of STB sprintf on checked due to ASAN violation
- Draw ImGui windows only when they're not in close_pending state
2025-10-13 22:08:52 +02:00
Gliniak
9054a29483 [UI] Add simple support for controller usage in UI
- Disabled unnecessary hotkeys thread when it is not used
- Removed problematic xam_exports static initialization
- Moved xam_dialogs_shown_ and xam_nui_dialogs_shown_ to XamState
2025-10-10 21:22:16 +02:00
Herman S.
3e89d53854 Fix menu hotkeys in Linux UI 2025-10-05 11:35:18 +02:00
Gliniak
2116660722 [UI] Added some missing glyphs that might be used in text 2025-09-30 18:29:40 +02:00