summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2026-02-18[GPU/WGF] Bind EDRAM to resolve dumping via ByteAddressBufferHEADmasterTriang3l
Simplifies binding by eliminating the need to switch between 32-bit and 64-bit views, and makes it possible to bind the EDRAM via a root descriptor on Direct3D 12.
2026-02-18[GPU/D3D12] Remove now-unused typed shared memory descriptorsTriang3l
All usage instances changed to ByteAddressBuffer.
2026-02-17[GPU/WGF] Use ByteAddressBuffer in precompiled shadersTriang3l
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-01-20[GPU/D3D12] Convert gamma-as-linear red to gamma in transfers to stencilTriang3l
Co-authored-by: Herman S. <429230+has207@users.noreply.github.com>
2026-01-19[GPU/D3D12] Add forgotten gamma conversion format checkTriang3l
2026-01-18[GPU] 8-bit PWL gamma RT as linear 16-bit UNorm on the hostTriang3l
With render target HLE, directly store linear values as R16G16B16A16_UNORM without gamma conversion, as this format provides more than enough bits (need at least 11 per component due to the maximum scale being 2^3 in the piecewise linear gamma curve) to represent linear values without precision loss. This makes blending work correctly in linear space, improving quality of transparency, lighting passes, and fixing issues such as transparent parts of impact and footstep decals in 4D5307E6 being bright instead. The new behavior is enabled by default, as it hugely improves the accuracy of emulation of this format, that is pretty commonplace in Xbox 360 games, with likely just a small GPU memory and bandwidth usage increase, compared to the alternatives that were previously available on the HLE RB path. It's currently implemented only on Direct3D 12, as most of the current GPU emulation code is planned to be phased out and redone, and no methods other than 8-bit with pre-conversion were implemented on Vulkan previously. To implement on Vulkan later, same conversion as in the Direct3D 12 implementation will need to be done in ownership transfer and resolve shaders. Currently it's somewhat inconvenient to decouple the conversion functions in `SpirvShaderTranslator` from an instance of the translator due to vector constant usage. Later, simpler SPIR-V generation functions may be added (`spv::Builder` usage in general is overly verbose). The previously default method (8-bit storage with pre-conversion in shaders and incorrect blending) can be re-enabled by setting the "gamma_render_target_as_unorm16" configuration option to `false`. This may be useful if the game, for instance, switches between 8_8_8_8_GAMMA and 8_8_8_8 formats for the same data frequently, as switching will result in EDRAM range ownership transfer data copying now. Also, the old path is preserved for Vulkan devices not supporting R16G16B16A16_UNORM with blending. The other workaround that was available previously, replacing the PWL encoding with host hardware sRGB with linear-space blending in render target management and in texture fetching, was also inherently inaccurate in many ways (especially when games have their own PWL encoding math, like 4541080F that displayed incorrect colors on the loading screen), and required tracking of the encoding needed for ranges in the memory. The sRGB workaround therefore was deleted in this commit, greatly simplifying the code in the parts of render target, texture and memory management and shader generation that were involved in it.
2026-01-15[GPU] Change "bpe" to "bpb" (bytes per block) in commentsTriang3l
Forgotten in the other "element" to "block" change.
2026-01-15[GPU] Change "element" name back to "block" in texture addressingTriang3l
The 32_32_32_FLOAT format seems to be vertex-only, so it looks like there can't be storage elements smaller than a single texel. So, use a more precise name that can't be confused with "picture element" (pixel) or "texture element" (texel) that represents a single logical pixel rather than a storage block of pixels.
2026-01-14[D3D12] Include recent D3D12 headers from the Microsoft GitHubTriang3l
2026-01-14[GPU] Change texture address local X offsetting back to additionTriang3l
More likely to be emitted as an immediate load/store offset in host hardware shaders.
2026-01-13[GPU] Use XOR to flip X texel group in all load/resolve shadersTriang3l
For visual consistency (missed in the commit that added LocalXAddressXor).
2026-01-13[GPU] XeResolveLocalXAddressXor comment typo correctionTriang3l
2026-01-13[GPU] Simplify local X offsetting with resolution scalingTriang3l
Switch between even and odd 16-byte element sequences along X by simply flipping a bit rather than going to a different resolution-scaled group of pixels, by increasing the size of the group within the constraints imposed by tiling.
2026-01-13[GPU] Rename AddressTiled in TiledAddress in shadersTriang3l
There will possibly be more `XenosTextureTiled*` functions in the future where the word "Address" would make the names excessively long.
2026-01-13[GPU] Add macro tile size constants to texture addressing headersTriang3l
2026-01-06[GPU] Remove now-unused texture_conversion.cc/hTriang3l
2026-01-06[GPU] Document tiled texture address bitsTriang3l
Will be useful for calculating memory extents more precisely in the future.
2026-01-04[Vulkan] Recompile internal shaders with Vulkan SDK 1.4.335.0Triang3l
spirv-remap was replaced with spirv-opt --canonicalize-ids, and debug information is preserved now.
2025-12-14[Vulkan] Clamp device API version to one Xenia was tested onTriang3l
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[D3D12/Vulkan] Simplify host GPU fence managementTriang3l
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-08-20[Base/Memory] Fix VirtualQuery length parameterguccigang420
2025-08-20[GPU] Change texture load cbuffer to push constantsTriang3l
Simplify the code, eliminating the need for supporting requesting cbuffers for anything other than guest draw command execution.
2025-08-19[GPU/UI] XeSL readability improvements + float suffixTriang3l
Use the _xe suffix instead of the xesl_ prefix for quicker visual recognition of identifiers, also switch to snake_case for consistency. Also add the f suffix to float32 literals because the Metal Shading Language is based on C++.
2025-08-15[Vulkan] Fix VulkanInstance::Create return valuesTriang3l
2025-08-14[Vulkan] Refactoring and fixes for VulkanProvider and related areasTriang3l
Enable portability subset physical device enumeration. Don't use Vulkan 1.1+ logical devices on Vulkan 1.0 instances due to the VkApplicationInfo::apiVersion specification. Make sure all extension dependencies are enabled when creating a device. Prefer exposing feature support over extension support via the device interface to avoid causing confusion with regard to promoted extensions (especially those that required some features as extensions, but had those features made optional when they were promoted). Allow creating presentation-only devices, not demanding any optional features beyond the basic Vulkan 1.0, for use cases such as internal tools or CPU rendering. Require the independentBlend feature for GPU emulation as working around is complicated, while support is almost ubiquitous. Move the graphics system initialization fatal error message to xenia_main after attempting to initialize all implementations, for automatic fallback to other implementations in the future. Log Vulkan driver info. Improve Vulkan debug message logging, enabled by default. Refactor code, with simplified logic for enabling extensions and layers.
2025-08-06[GPU] Cleanup definitions of some registersTriang3l
VS/PS_NUM_REG is 6-bit on Adreno 200, and games aren't seen using the bit 7 to indicate that no GPRs are used. It's not clear why Freedreno configures it this way. Some texture fetch fields were deprecated or moved during the development of the Xenos, reflect that in the comments. Add definitions of the registers configuring the conversion of vertex positions to fixed-point. Although there isn't much that can be done with it when emulating using PC GPU APIs, there are some places in Xenia that wrongly (though sometimes deliberately, for results closer to the behavior of the host GPU) assume that the conversion works like in Direct3D 10+, however the Xenos supports only up to 4 subpixel bits rather than 8. The effects of this difference are largely negligible, though. Also add more detailed info about register references and differences from other ATI/AMD GPUs for potential future contributors.
2025-07-30[CPU/HIR] Fixed MulHi in value.cc for Linux systemsguccigang420
2024-05-25[Vulkan] Shader memory export (#145)Triang3l
2024-05-18[GPU] Fix gamma ramp writing after RegisterFile API change (#2262)Triang3l
2024-05-16[SPIR-V] Use a helper class for most if/else branchingTriang3l
Simplifies emission of the blocks themselves (including inserting blocks into the function's block list in the correct order), as well as phi after the branching. Also fixes 64bpp storing with blending in the fragment shader interlock render backend implementation (had a typo that caused the high 32 bits to overwrite the low ones).
2024-05-12[GPU] Check memexport stream constant upper bits in range gatheringTriang3l
2024-05-12[Base/GPU] Cleanup float comparisons and NaN and -0 in clampingTriang3l
C++ relational operators are supposed to raise FE_INVALID if an argument is NaN, use std::isless/greater[equal] instead where they were easy to locate (though there are other places possibly, mostly min/max and clamp usage was checked). Also fixes a copy-paste error making the CPU shader interpreter execute MINs as MAXs instead.
2024-05-12[Base] Relax the system clock difference allowance in the testTriang3l
Hopefully should reduce the CI failure rate, although this testing approach is fundamentally flawed as it depends on OS scheduling.
2024-05-12[GPU] Remove register reinterpret_casts + WAIT_REG_MEM volatilityTriang3l
Hopefully prevents some potential #1971-like situations. WAIT_REG_MEM's implementation also allowed the compiler to load the value only once, which caused an infinite loop with the other changes in the commit (even in debug builds), so it's now accessed as volatile. Possibly it would be even better to replace it with some (acquire/release?) atomic load/store some day at least for the registers actually seen as participating in those waits. Also fixes the endianness being handled only on the first wait iteration in WAIT_REG_MEM.
2024-05-12[Base] Add aliasing-safe xe::memory::ReinterpretTriang3l
Accessing the same memory as different types (other than char) using reinterpret_cast or a union is undefined behavior that has already caused issues like #1971. Also adds a XE_RESTRICT_VAR definition for declaring non-aliasing pointers in performance-critical areas in the future.
2024-05-05[Vulkan] Non-seamless cube map filteringTriang3l
2024-05-04[Vulkan] Optional functionality usage improvementsTriang3l
Functional changes: - Enable only actually used features, as drivers may take more optimal paths when certain features are disabled. - Support VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE. - Fix the separateStencilMaskRef check doing the opposite. - Support shaderRoundingModeRTEFloat32. - Fix vkGetDeviceBufferMemoryRequirements pointer not passed to the Vulkan Memory Allocator. Stylistic changes: - Move all device extensions, properties and features to one structure, especially simplifying portability subset feature checks, and also making it easier to request new extension functionality in the future. - Remove extension suffixes from usage of promoted extensions.
2024-05-02[GPU] Declare unused register fields explicitlyTriang3l
2023-09-14[VFS] Fixed invalid month decoding in decode_fat_timestampGliniak
2023-09-14[Testing] Added test project for vfsGliniak
- Added test case for: decode_fat_timestamp - Changed location of: decode_fat_timestamp
2023-07-27[CPU] Added constant propagation pass for: OPCODE_AND_NOTGliniak
2023-07-27[Base] Add missing #include <cstdint> to utf8.ccAdriano Martins
2023-06-09[NET] NetDll___WSAFDIsSet: Fixed incorrect endianness of fd_countGliniak
Plus: limit it to 64 entries Thanks to Bo98 for pointing that out
2023-06-09[Base] Filter out relative directories on linuxRoy Stewart
2023-06-09[Base] Set the path for posix file infoRoy Stewart
2023-06-09[XAM] Implemented XamGetCurrentTitleIdAdrian
2023-06-09[XAM] xeXamContentCreate - Disposition cleanupGliniak
2023-06-09[Base] ListFiles: Prevent leakage of file descriptorsGliniak
2023-05-29[x64] Add AVX512 optimizations for `OPCODE_VECTOR_COMPARE_UGT`(Integer)Wunkolo
AVX512 has native unsigned integer comparisons instructions, removing the need to XOR the most-significant-bit with a constant in memory to use the signed comparison instructions. These instructions only write to a k-mask register though and need an additional call to `vpmovm2*` to turn the mask-register into a vector-mask register. As of Icelake: `vpcmpu*` is all L3/T1 `vpmovm2d` is L1/T0.33 `vpmovm2{b,w}` is L3/T0.33 As of Zen4: `vpcmpu*` is all L3/T0.50 `vpmovm2*` is all L1/T0.25
2023-05-29[PPC] Implement `vsubcuw`Wunkolo
Other half of #2125. I don't know of any title that utilizes this instruction, but I went ahead and implemented it for completeness. Verified the implementation with `instr__gen_vsubcuw` from #1348. Can be grabbed with: ``` git checkout origin/gen_tests -- src\xenia\cpu\ppc\testing\*vsubcuw.s ```