Commit Graph

945 Commits

Author SHA1 Message Date
Zephyron
ba9dead3ee Stub VOTE_vtg implementation with warning log 2025-11-12 19:16:12 +10:00
Zephyron
652a6a56ef feat: add Snapdragon 8 Elite support and implement shader features
- Add device detection for Snapdragon 8 Elite (device ID 0x43052c01)
- Disable shader float controls and 64-bit integer atomics on Qualcomm
  proprietary drivers to work around driver limitations
- Enable native BGR format support on S8 Elite (similar to S8 Gen 2)
- Implement VOTE_vtg instruction for vertex/tessellation/geometry shaders
  with proper single-thread semantics
- Replace stub warnings with detailed comments for FCSM_TR flow test and
  SR_WSCALEFACTOR special registers to document expected behavior

These changes improve compatibility with Qualcomm Snapdragon 8 Elite
devices and reduce spurious warnings by documenting shader features
that are correctly handled as conservative defaults.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-11-04 20:41:13 +10:00
Zephyron
d5081c3919 fix: implement missing shader recompiler instructions
Resolves compilation errors in move_register.cpp by using proper
register offset approach instead of non-existent Y/Z/W methods.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-22 21:13:00 +10:00
Zephyron
c425e3b06f fix: implement missing shader recompiler instructions
- Implement FSWZADD NDV mode support by removing stubbed warning
- Add proper SAM and RAM instruction implementations (no-op with logging)
- Implement comprehensive masked move operations for all mask patterns
- Remove all shader recompiler stubbed instruction warnings

Thanks to Dr.Stug for providing the logs that identified these missing implementations.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-22 20:59:04 +10:00
Zephyron
dd49615a48 shader_recompiler: Add missing texture types for SURED instruction
The SURED (Surface Reduction) instruction can operate on cube maps and 3D
texture arrays which were previously missing from the Type enum, causing
shader translation failures.

Changes:
- Add ARRAY_3D and CUBE to Type enum
- Map ARRAY_3D to Color3D and CUBE to ColorCube in GetType()
- Update MakeCoords() to handle array and cube coordinate generation

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-17 16:09:03 +10:00
Zephyron
d8d54c5ccf shader_recompiler: Fix alpha-to-coverage fragment output interface
The Vulkan spec requires fragment shaders to declare an output covering
Location 0, Component 3 (alpha) when alpha-to-coverage is enabled. This change:

- Tracks alpha_to_coverage_enabled through RuntimeInfo from pipeline state
- Forces declaration of frag_color[0] with full RGBA when enabled
- Initializes alpha to 1.0 in shader epilogue if not explicitly written

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-10-17 16:07:35 +10:00
collecting
fe88ad18a7 Memory Leak Fix 2025-09-26 04:20:43 +00:00
collecting
0993d4d86f Memory Leak Fix 2025-09-26 02:31:32 +00:00
collecting
9ffa26f177 Memory Leak Fix 2025-09-26 02:29:22 +00:00
Zephyron
2d890316ad shader_recompiler: Implement ISBERD instruction for internal stage buffer reads
This commit properly implements the ISBERD (Internal Stage Buffer Entry Read)
instruction that was previously stubbed. The implementation supports all
modes and shift types:

- Patch mode: Reads tessellation patch attributes using ir.GetPatch()
- Prim mode: Reads primitive attributes for geometry shaders
- Attr mode: Reads generic vertex attributes
- Default mode: Maintains backward compatibility

The implementation also supports:
- U16 and B32 shift modes for different data formats
- SKEW and O flags for advanced buffer addressing
- Proper data type conversions and bit casting

This fixes rendering issues in UE4 titles that rely on internal stage
buffer operations in tessellation and geometry shaders. The previous
stubbed implementation caused compatibility problems with modern
rendering pipelines.

Credit: Hayate Yoshida (吉田 疾風) <hayate@citron-emu.org> for discovering
the root cause and providing insight on the proper implementation approach.

Fixes: Internal stage buffer read operations in tessellation shaders
Resolves: UE4 title rendering issues related to ISBERD instruction
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-09-14 19:01:19 +10:00
Zephyron
ce06115c2c Revert "shader_recompiler: Implement ISBERD instruction"
This reverts commit d2c6f3ab9c.
2025-09-14 18:19:36 +10:00
Zephyron
d2c6f3ab9c shader_recompiler: Implement ISBERD instruction
- Replace stubbed ISBERD implementation with proper internal stage buffer read
- Add support for different modes (Default, Patch, Prim, Attr)
- Implement shift operations (U16, B32) for buffer data processing
- Convert float results from GetAttributeIndexed to unsigned integers
- Handle buffer index from source register for stage buffer access
- Maintain proper error handling for unimplemented features (SKEW, O)

This completes the internal stage buffer entry read functionality for Maxwell shader translation.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-25 16:26:05 +10:00
Zephyron
117c467ff3 feat: Add frame generation and enhance UE4 game compatibility
- Add frame generation settings (enabled/disabled, interpolation/extrapolation modes)
- Add frame skipping settings (enabled/disabled, adaptive/fixed modes)
- Implement frame skipping logic with adaptive and fixed modes
- Enhance UE4 crash handling with recovery mechanisms
- Add support for signed and float 32-bit image formats across shader backends
- Update Vulkan Validation Layers to v1.4.321.0
- Fix duplicate frame skipping options in Qt UI
- Improve memory handling for UE4 games (Hogwarts Legacy compatibility)
- Add enhanced bindless texture handling with fallback approach
- Update Android build configuration and dependencies

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-08-05 19:32:28 +10:00
Boss.sfc
fc480dcb69 fix: CachyOS LTO Compilation
Fix LTO linking issues on CachyOS with GCC 15.x

- Add LTO support to all core library targets (input_common, frontend_common,
  network, shader_recompiler, web_service) that were missing LTO configuration
- Create citron_configure_lto() helper function for consistent LTO handling
- Implement CachyOS-specific detection via /etc/os-release and kernel version
- Apply conservative LTO flags (-flto=auto -ffat-lto-objects) only for
  CachyOS + GCC 15+ to resolve linking errors with newer toolchains
- Other distributions continue using aggressive LTO settings for maximum performance
- Disable LTO on executable targets to prevent main function optimization issues

This resolves "undefined symbol" errors when building with -DCITRON_ENABLE_LTO=ON
on CachyOS while maintaining optimal LTO performance on other distributions.

Fixes linking errors including:
- Core::Frontend::EmuWindow symbols
- Core::System methods
- Settings::values
- Common logging functions

Tested on CachyOS with GCC 15.1.1 + LLD 20.1.8

Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
2025-07-22 21:37:37 +07:00
Boss.sfc
0fb39034c1 fix: Resolve compilation issues with fmt library and formatters
Fix multiple compilation errors preventing successful build:

* Add const qualifier to custom fmt formatter functions across codebase
  - Updated formatters in logging, shader recompiler, texture cache, and other modules
  - Ensures compatibility with newer fmt library versions

* Add missing fmt/ranges.h includes for fmt::join usage
  - Fixed fmt::join calls in Vulkan renderer, GDB stub, NFC service, and main window
  - Resolves "no member named 'join' in namespace 'fmt'" errors

* Exclude unsupported platforms from Boost.Process usage in debugger
  - Extended conditional compilation to avoid Boost.Process where unavailable

* Fix type casting issues in AOC service manager
  - Resolved std::min type mismatch with explicit casting
2025-07-16 11:11:33 +07:00
Zephyron
2e6bcc9ea6 video_core, shader_recompiler: Improve Princess Peach: Showtime! support and performance
1. Add geometry shader support for Princess Peach: Showtime!:
   - Implement proper EmitInvocationInfo handling for geometry shaders
   - Support input topology vertex counting in all shader backends (GLASM, GLSL, SPIRV)

2. Performance optimizations:
   - Replace InputTopologyVertices switch statement with a constexpr lookup table
   - Pre-calculate vertex counts and shifts to reduce register pressure
   - Eliminate redundant calculations in shader backends

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-11 16:28:25 +10:00
Zephyron
b2d9cf4a01 chore: update project branding to CITRON
Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-06 16:11:33 +10:00
Narr the Reg
4f95ee5209 Merge pull request #13075 from liamwhite/mali-having-a-bad-time
shader_recompiler: throw on missing geometry streams in geometry shaders
2024-02-22 11:30:26 -06:00
Liam
f46dc31683 shader_recompiler: throw on missing geometry streams in geometry shaders 2024-02-19 00:34:00 -05:00
Liam
462ea921e3 shader_recompiler: fix non-const offset for arrayed image types 2024-02-15 18:49:23 -05:00
Liam
cb29aa0473 Revert "shader_recompiler: use only ConstOffset for OpImageFetch"
This reverts commit f296a9ce9a.
2024-02-15 18:38:56 -05:00
Liam
f296a9ce9a shader_recompiler: use only ConstOffset for OpImageFetch 2024-02-05 12:01:09 -05:00
liamwhite
97c8b49444 Merge pull request #12644 from liamwhite/vkspec-image-offset
shader_recompiler: fix Offset operand usage for non-OpImage*Gather
2024-01-18 21:18:19 -05:00
Viktor Szépe
90ab89a0b0 Merge remote-tracking branch 'origin/master' into typos3 2024-01-16 00:09:00 +00:00
Viktor Szépe
2044ae6b3a Fix more typos 2024-01-15 23:26:53 +00:00
Liam
2a0d707ce1 shader_recompiler: emulate 8-bit and 16-bit storage writes with cas loop 2024-01-11 16:50:59 -05:00
Liam
2044a289f8 shader_recompiler: fix Offset operand usage for non-OpImage*Gather 2024-01-11 00:56:37 -05:00
Viktor Szépe
a959fb011f Fix "Propietary" typo elsewhere 2024-01-07 23:15:38 +00:00
liamwhite
92a331af76 Merge pull request #12437 from ameerj/gl-amd-fixes
OpenGL: Fixes and workaround updates for AMD
2024-01-04 15:53:44 -05:00
Liam
d0c60605ab shader_recompiler: use default value for clip distances array 2023-12-26 19:32:47 -05:00
Liam
6697b665ca shader_recompiler: respect clip distance limits in indexed store 2023-12-26 19:10:25 -05:00
Fernando S
820f113d9e Merge pull request #12435 from liamwhite/type-check
shader_recompiler: ensure derivatives for textureGrad are f32
2023-12-22 17:41:13 +01:00
Ameer J
d5d0d2cb0e spirv_emit_context: Fix BaseInstance for OGL spirv 2023-12-21 21:53:24 -05:00
Liam
4aa713e861 shader_recompiler: ensure derivatives for textureGrad are f32 2023-12-21 19:06:33 -05:00
Liam
9e9aed41be shader_recompiler: use float image operations on load/store when required 2023-12-21 14:34:46 -05:00
Ameer J
a5b2b8b91b emit_glsl_image: Use inlined texelFetch offsets 2023-12-20 19:24:11 -05:00
Liam
fcfa8b680b shader_recompiler: use minimal clip distance array 2023-12-18 22:25:14 -05:00
Liam
94244437de shader_recompiler: ignore clip distances beyond driver support level 2023-12-18 22:25:14 -05:00
liamwhite
6da8301773 Merge pull request #12196 from ameerj/glsl-cbuf-sizes
GLSL: Use known cbuf sizes when possible
2023-12-03 16:27:07 -05:00
Ameer J
db1d32485e GLSL: Prefer known used cbuf sizes 2023-11-26 23:25:29 -05:00
Ameer J
1d11fe00a3 Merge branch 'master' into ssbo-align 2023-11-26 21:08:53 -05:00
Liam
473caaff5b renderer_vulkan: ignore viewport stores on non-supporting drivers 2023-11-19 11:27:12 -05:00
liamwhite
4458920799 Merge pull request #12066 from ameerj/nvidia-nsanity
shader_recompiler: add byteswap pattern workaround for Nvidia
2023-11-19 09:49:45 -05:00
Ameer J
feb60de5c3 shader_recompiler: Fix spelling of "derivate" (#12067) 2023-11-18 13:39:47 +01:00
Ameer J
9343b81afd shader_recompiler: add byteswap pattern workaround for Nvidia 2023-11-17 22:29:12 -05:00
Ameer J
75c5be55af shader_recompiler: Align SSBO offsets in GlobalMemory functions 2023-10-31 20:14:18 -04:00
Ameer J
7d34800531 shader_recompiler: Align SSBO offsets to meet host requirements
Co-Authored-By: Billy Laws <blaws05@gmail.com>
2023-10-31 20:10:54 -04:00
liamwhite
da5c49f22d Merge pull request #11847 from ameerj/glsl-shfl-fix
emit_glsl_warp: Fix shfl_in_bounds conditional
2023-10-23 10:33:24 -04:00
Ameer J
cfe73af6f2 emit_glsl_warp: Fix shfl_in_bounds conditional 2023-10-22 00:45:23 -04:00
Kelebek1
e02ee8e59d Manually robust on Maxwell and earlier 2023-10-19 19:54:31 +01:00