Commit Graph

8640 Commits

Author SHA1 Message Date
bomabomabomaboma
d0dd989238 [GPU] Honor force_bc_w_to_max: force sampler border color alpha to 1.0
Co-authored-by: Herman S. <429230+has207@users.noreply.github.com>
2026-08-04 10:34:42 +02:00
bomabomabomaboma
084f14ec41 [Vulkan] Use VK_EXT_custom_border_color for YCbCr texture border colors
Co-authored-by: Herman S. <429230+has207@users.noreply.github.com>
2026-08-04 10:34:42 +02:00
bomabomabomaboma
ac42250688 [GPU] Fix 20e4 bit span in Depth20e4To32 comments 2026-08-04 10:34:42 +02:00
bomabomabomaboma
e519d59e40 [Vulkan] Fix stacked-texture inter-layer lerp base in SampleTexture
Co-authored-by: Herman S. <429230+has207@users.noreply.github.com>
2026-08-04 10:34:42 +02:00
bomabomabomaboma
f3e42609a2 [GPU] Fix mantissa placement in CPU Float7e3To32
Co-authored-by: Herman S. <429230+has207@users.noreply.github.com>
2026-08-04 10:34:42 +02:00
goldislead
fbdb1f2817 [GPU] Handle two component tfetch1D coordinates
545407D4's UI shader uses tfetch1D with a nonreplicated source swizzle and a 2D constant. The way we have it set up is causing the translators to sample with Y set to 0.

Handle this as 2D in the translators. Normal scalar tfetch1D untouched.
2026-08-04 07:22:48 +02:00
Gliniak
fe40c0d68f [Kernel] Fixed regression related to X_OBJECT_HEADER struct 2026-08-03 21:07:14 +02:00
Gliniak
7ef873b0d5 [Audio] Added mutex for each audio client
This should prevent crashing when there is TOCTOU case in audio worker loop
2026-08-03 09:05:27 +02:00
Adrian
889d93e134 [Kernel] Fixed X_OBJECT_HEADER 2026-08-03 09:04:10 +02:00
The-Little-Wolf
a0e1ba8313 [XAM/INFO] - Stub XamQueryLiveHive & XamGetLiveHiveValue functions
- Stub XamQueryLiveHive & XamGetLiveHiveValue functions
- Stub XNetLogonGetMachineID
2026-08-03 09:03:15 +02:00
The-Little-Wolf
6d530a1ab9 [XBOXKRNL/IO] - Add missing structs for IoCreateDevice
- Add missing structs for IoCreateDevice
2026-08-03 08:42:12 +02:00
The-Little-Wolf
131503f68d [XEX] - add more file signatures
- Add older xex file signatures
- Add xex1 devkit key
- Add xex1 support
2026-08-02 22:00:14 +02:00
goldislead
8486e97a06 [GPU] Sample locked mip unnormalized fetches in the mip's grid
Fixes visibility popping in 555308B6 and 5553080B.

Unnormalized texture coordinates address texels of the mip level being sampled, not always the base level. The titles in question lock the fetch constant to one mip and address that mip's grid. The denominator was still the base level size, so each reduction after the first read garbage.

So the locked size is now used for 2D fetches (point filter, clamp-to-edge) with MipMinLevel == MipMaxLevel. Everything else keeps the base level denominator until a shared effective LOD model exists.
2026-08-02 20:53:25 +02:00
The-Little-Wolf
364dc1d770 [XBOXKRNL/IO] - add structs for NtDeviceIoControlFile
- Add structs for NtDeviceIoControlFile
2026-08-02 19:12:54 +02:00
goldislead
da47dfaacf [GPU/DXBC] Fix signed round bias breaking memexport
Write the bias into round_bias_temp as intended in both packed 8/16/32bpp path and 16_16_16_16.

The copysign rounding bias was targeted the eM register, and destroying the scaled value, then added round_bias_temp, which nothing had written.
2026-08-02 18:05:24 +02:00
Gliniak
7010c86fb1 Revert "[Kernel] Initial XMP Notifications"
This reverts commit 0c6dc9b628.
2026-07-30 20:02:22 +02:00
Adrian
e4f28f6984 [Kernel] Fixed object type 2026-07-30 16:55:27 +02:00
The-Little-Wolf
2585d3cd69 [XAM/NET] - Stub XampXAuth functions
- Stub XampXAuthStartup, XampXAuthShutdown, XampXAuthGetTitleBuffer
2026-07-30 09:52:59 +02:00
Adrian
1807da06db [Kernel] Added usage of X_DISPATCHER_FLAGS 2026-07-30 08:54:23 +02:00
bomabomabomaboma
2ddc5ef737 [GPU] 8_8_8_8_GAMMA resolve update; fix unsigned-biased fetch scaling
8_8_8_8_GAMMA resolve update:
This hopefully settles how safe resolves of gamma RTs are handled, because it's almost certainly not settled by destination.

It's now believed that gamma sources seen by resolve are always being decoded, and that's a decode that's keyed only on the source format, where every destination is fed linear values, and any encode is now just removed rather than conditional.

These sources are re-alised as plain before resolving, which is the same exact idea that preserves float 2_10_10_10 bits through a resolve too.

Integer texture fetch scaling update:
Unsigned-biased components were using the regular unsigned scale even though the conversion had remapped the sample [0, 1] to [-1, 1].

Scale bits data is now increased from 5 to 6 bits and use the new bit to mark unsigned-biased components. DXBC/SPIR-V use half of the unsigned scale and add a -0.5 offset.

This fixes post-processing in 415608B2 and will likely improve other titles w/ EDRAM transports through affected textures, but perhaps not so dramatically.
2026-07-30 07:34:28 +02:00
Adrian
888b9ad258 [Kernel] Added cvar for loading XDBM
XDBM triggers anti-cheat in BO2.
2026-07-27 21:44:26 +02:00
Adrian
0c6dc9b628 [Kernel] Initial XMP Notifications 2026-07-27 21:03:16 +02:00
The-Little-Wolf
7d8be7f17e [XEX] - Add missing xex2_system_flags_32 flags
-  Add missing xex2_system_flags_32 flags
2026-07-27 10:45:20 +02:00
goldislead
8f55b4abf7 [GPU] Store Vulkan gamma RTs as linear UNORM16
Roughly matching D3D12, R16G16B16A16_UNORM is used for gamma RTs when sampled and blendable color attachments are supported. The host target is kept linear for blending, and converted during ownership transfers, clears, and readbacks.

Shares the PWL conversion helpers between the translator and RT cache. Raw gamma bytes are decoded to safe linear midpoints so round trips preserve the original bytes.
2026-07-24 21:46:46 +02:00
The-Little-Wolf
6e9bac0dff [XAM/INFO] - Stub XamXStudioRequest
- Stub XamXStudioRequest to stop log spam
2026-07-24 08:53:26 +02:00
Herman S
ed4540a641 [XAM] Remove XMP polling throttle sleeps
Fixes audio in Tekken Tag 2 and Def Jam Icon. Improves framerates in
Radiant Silvergun and Split/Second.
2026-07-23 16:58:42 +02:00
Gliniak
913ec6b9b2 [XAM] Limit guest UI to only one instance
This fixes potential crashing in games that spam UI show calls
2026-07-23 16:49:33 +02:00
goldislead
74db632ab3 [GPU] draw_resolution_scale_threshold for host render targets
Implements resolution scale selection, per surface, for both backends.

Surfaces with pitches at or below the defined threshold render at 1x1 while everything else scales. This catches downscaled post-process chains that gain nothing from upscaling and often break from it. 0 leaves everything scaled.

Class is a function of pitch and MSAA samples, baked into RenderTargetKey, and the caches create, clear, transfer, and dump per that class. Transfer shaders carry separate dest and source scales. Pixel shaders get a modification bit so 1x1 draws translate with 1x addressing for param_gen and memexport, and per-draw viewports, point sizes, and divisors pull from RT cache instead of draw_resolution_scale_x/y.

1x1 resolves copy unscaled data straight into shared memory and unmark the range from scaled resolve page tracking, so textures pick up the correct copy. Readback resolves skip downscaling when appropriate. ZPD normalizes per segment so mixed reports don't undercount.

Host RT only. ROV/FSI EDRAM layout assumes a single global scale and, while implementing support for scale selection is probably doable, it's likely an enormous task.
2026-07-23 14:18:03 +02:00
Adrian
536900e76b [XAM] Cleanup XamGetCachedTitleName 2026-07-23 13:30:51 +02:00
goldislead
a635ac64f5 [GPU] Scaled resolve readback through downscale CS
Implements readback for resolution-scaled resolves in both D3D12 & Vulkan backends, mostly mirroring Xenia Edge's approach, with a few small adjustments.

The scaled resolve buffer stores each texel as a group aligned scale_x by scale_y block. A small CS now reverses that packing per 32x32 tile and writes 1x. So far, this is Edge's approach verbatim. This slightly diverges from Edge since now the source window is bound at the written extent, not the texture base & the tail after the last whole tile is no longer copied.

Dest format and texel size are the same ResolveInfo the written extent was calculated with rather than rereading RB_COPY_DEST_INFO, which probably matters for depth resolves where the register holds k_8. 128bpp dests, extents that aren't group-aligned, and extents outside the scaled range skip readback.
2026-07-19 10:13:00 +02:00
Adrian
23b79f2a97 [XAM] Removed returning error in XamUserCreateAchievementEnumerator 2026-07-18 19:24:08 +02:00
goldislead
16e1eb8e28 [GPU] Clarify 64bpp clear register order
This resolves the TODO in GetColorClearShaderConstants about which 32 bit portion is in which register.

For 64bpp formats, RB_COLOR_CLEAR_LO holds the lower 32 bits of the packed clear value, and RB_COLOR_CLEAR holds the upper 32 bits.
2026-07-17 08:18:56 +02:00
NicknineTheEagle
c6298dd0e3 [XAM] Implemented game exit behavior in XamLoaderTerminateTitle 2026-07-16 11:48:30 +02:00
Gliniak
44e1a64f35 [XAM] Extend UI delay on close. Added delay to headless after notification sent.
Created thread to do async notification broadcast on close for headless.

This fixes game freeze in 534407FC
2026-07-16 11:17:16 +02:00
Gliniak
c2650c6e58 [Testing] Define full test paths, unify test results of vectors to unsigned type 2026-07-16 10:47:15 +02:00
Gliniak
7ff152a5a7 [X64] MAX_V128/MIN_V128 Proper NaN handling.
According to console. FFC00000->FFC00000 instead of FFFFFC00 as it was previously.

Test case: 415607E8 - "Evil Queen's Castle" level
2026-07-15 23:31:38 +02:00
The-Little-Wolf
51322122a5 [Xam/Info] - Implement XamFeatureEnabled
- Implement XamFeatureEnabled
2026-07-15 19:55:04 +02:00
Gliniak
deaf21e9e1 [CI] Fixed CI failure caused by incorrect variable check 2026-07-15 19:53:27 +02:00
The-Little-Wolf
2799234fbb [Xam/XMP] - Stub XMPGetNumSongsInTitlePlaylist
- Stub XMPGetNumSongsInTitlePlaylist
2026-07-15 09:18:46 +02:00
SaveEditors
e20f26963f [GPU] Initialize GPU registers to hardware reset defaults
RegisterFile zeroes the whole register file at construction, but a real
console comes up with non-zero values in several of the context
registers. If a game reads one of those before writing it, it gets 0
under emulation and the real default on hardware.

I read the reset values off a retail console (read-only) and checked
them against the AMD R6xx register reference and the r600g defaults in
Mesa, which set the same registers to the same values at context init.
Where the hardware read matches the driver default it's a genuine
power-on default, not leftover runtime state.

Left the tessellation levels out on purpose: they reset to 1.0f too, but
the backends do register + 1.0f, so seeding them here would change the
effective reset factor. That needs its own change.
2026-07-14 21:07:49 +02:00
Margen67
bad346717a [xb] Skip aarch64 submodule for x64 target 2026-07-14 03:24:00 -07:00
Gliniak
22d91c86e8 [Kernel] Restored yield in XAudioGetVoiceCategoryVolumeChangeMask
Thanks to latest change there is no need to use hardcoded nanosleep, so we can go back to previous stuff.
Hopefully it will fix some random issues with audio introduced lately
2026-07-10 22:52:51 +02:00
oreyg
6e5b8324f4 [APU] Pace audio subsystem 2026-07-08 19:24:32 +02:00
The-Little-Wolf
d804cf828a [Xam/Locale] - Sketchy Implementation of XamGetLanguageTypefacePatch
- Sketchy Implementation of XamGetLanguageTypefacePatch
2026-07-08 11:44:40 +02:00
goldislead
d119505289 [GPU] Texture integer scaling fetches; 8_8_8_8_GAMMA resolve
Integer num_format fetches now get their scale CPU-side instead of trying to guess in the shader. This is authoritative; no cvar. Both translators now use texture_integer_scale_bits after signs/gamma and before exponent bias. This alone fixes black screens and a bunch of rendering bugs across at least several dozen titles.

This new information lives in the updated FormatInfo table, including fixed component widths.

Resolve also has two new fixes.

8_8_8_8_GAMMA EDRAM sources can now decode through the PWL curve while still in linear space, before MSAA resolve or format conversion, then re-encoded for gamma destinations. This is also now default enabled via gamma_decode_pwl_resolve and has improved blowout in at least 4 titles, with no obvious regressions thus far.

Full resolve can also now pack fixed destinations according to copy_dest_number.
2026-07-06 20:51:02 +02:00
The-Little-Wolf
573cce0fe2 [Xam/Locale] - Implement XTLGetLanguageV2
- Implement XTLGetLanguageV2
- Used by Internet Explorer
2026-07-04 20:57:20 +02:00
Gliniak
e45c25c4c9 [XAM] Added check for UserSetting max ID 2026-07-04 20:25:18 +02:00
Adrian
35c513bfa2 [XAM] Fixed UserData reading incorrect variant type 2026-07-04 14:47:33 +02:00
Adrian
2c94e46727 [GPU] Reduce log spam from D3D12 pipeline 2026-07-03 18:24:32 +02:00
Gliniak
9588ce244d [CPU/X64] Preserve NaN bit during float->double, double->float conversion
Probably this should be moved to ppc_emit_memory level instead of being x86-64 specific

Was AI used in this change: Yes
2026-06-29 22:50:14 +02:00