summaryrefslogtreecommitdiff
path: root/src/shader_recompiler
AgeCommit message (Collapse)Author
2025-02-28shader_recompiler: Implement vertex count lookup for Geometry stageZephyron
Add proper handling of input topologies in the Geometry stage for all three shader backends (GLASM, GLSL, SPIRV). This implementation uses a lookup table approach to determine vertex counts based on input topology type (Points, Lines, LinesAdjacency, Triangles, TrianglesAdjacency) and shifts the vertex count by 16 bits as required by the invocation info format. Additional changes: - Fixed TessellationControl and TessellationEval stages to properly break after emitting code - Added proper header include for runtime_info.h in GLASM backend - Improved code documentation with clear commenting patterns This change ensures accurate geometry shader behavior across all backends, improving compatibility with games that rely on proper vertex count reporting. Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-02-16build: upgrade fmt and SDL2Zephyron
Update fmt library to version 11.0.2 and make necessary adjustments: - Replace fmt/format.h includes with fmt/ranges.h - Add const qualifiers to formatter::format functions - Update CMake to require fmt version 11 Additional dependency updates: - Update SDL2 bundled version from 2.28.2 to 2.32.0 - Update catch2 to version 3.8.0 - Update vcpkg baseline to c82f74667287d3dc386bce81e44964370c91a289
2025-01-20shader: Implement EmitInvocationInfo across all backendsZephyron
- Add proper invocation info handling for tessellation and fragment stages - Return patch vertices info shifted by 16 bits for tessellation stages - Return sample mask shifted by 16 bits for fragment stage - Return standard format (0x00ff0000) for compute and other stages - Implement consistently across SPIRV, GLSL, and GLASM backends - Remove stubbed warning message
2025-01-17shader_recompiler: Add stubs for CSM/FCSM flow test conditionsZephyron
Add stub implementations for previously unhandled flow test conditions in the shader recompiler's IR emitter. These conditions were previously throwing "Not Implemented" exceptions when encountered. The following flow test cases are now stubbed: - FCSM_TR (Fragment Shader Coarse/Fine Mode Test and Reject) - CSM_TA (Coarse/Fine Mode Test Accept) - CSM_TR (Coarse/Fine Mode Test and Reject) - CSM_MX (Coarse/Fine Mode Maximum) - FCSM_TA (Fragment Shader Coarse/Fine Mode Test Accept) - FCSM_MX (Fragment Shader Coarse/Fine Mode Maximum) Currently these stubs: 1. Return false (ir.Imm1(false)) as a placeholder value 2. Log a warning message indicating the stub 3. Allow shaders using these conditions to compile rather than fail This is a step toward proper implementation of coarse/fine mode shader operations. The stubs prevent crashes while making it clear which code paths need full implementation. Technical notes: - Removed the previous FCSM_TR implementation that used flag operations - Added consistent warning messages for tracking stub usage - Kept within the existing GetFlowTest switch statement structure
2025-01-17Downgrade Android SDK and build toolsZephyron
- Reduce compileSdkVersion and targetSdk from 35 to 34 - Change NDK version to 26.1.10909125 - Downgrade Android Gradle Plugin from 8.8.0 to 8.1.2 - Add androidx.constraintlayout dependency These changes improve compatibility with current Android development environment and add necessary layout support.
2025-01-17Revert "shader-recompiler: implement FCSM_TR flow test case"vampiric_x
This reverts commit 496b010927d7db3bcd6c52ddeadf34b9d9ca4f3a.
2025-01-15shader-recompiler: implement FCSM_TR flow test caseZephyron
Remove the stubbed implementation of FCSM_TR (Forward Condition Set Mode - Thread Reduction) flow test and replace it with an initial implementation using SFlag and ZFlag conditions. This provides basic functionality while allowing for future refinement based on specific shader architecture requirements.
2025-01-14Revert incorrect copyright attribution for non-contributed filesZephyron
- In commit b3facaa6bb30cdc39f2b7d632fef1e3bfeee7785, the copyright header was updated to include "Citron Homebrew Project" across multiple files, regardless of whether any contributions were made. - This commit removes the incorrect attribution and reverts the copyright header to its previous state. - Copyright attribution should only be added when meaningful contributions have been made to the file. - This commit ensures proper compliance with copyright standards and maintains correct attribution to the respective contributors. - Special thanks to Tachi for pointing out the need for these corrections and ensuring that proper attribution practices are followed.
2024-12-31shader_recompiler: Fix ISBERD instruction implementationZephyron
- Simplify ISBERD instruction to handle register-to-register moves - Remove incorrect CompositeConstruct usage - Replace with direct register value passing - Fix compilation errors in internal stage buffer handling
2024-12-31shader_recompiler: Use FPRecip in FSWZADD implementationZephyron
Simplifies the negative reciprocal calculation in FSWZADD by using the dedicated FPRecip operation instead of manually constructing a division. This change: - Replaces FPDiv(Imm32(f32(1.0f)), src_b) with FPRecip(src_b) - Results in more efficient code for calculating 1.0/x - Fixes build errors from undefined IR emitter methods
2024-12-31shader_recompiler: Fix method names in FSWZADD implementationZephyron
Fixes incorrect method names in the floating point swizzled add implementation: - FNeg -> FPNeg - FDiv -> FPDiv - FImm32(1.0f) -> Imm32(ir.f32(1.0f)) These changes align with the correct IR emitter interface naming conventions, where floating-point operations use the 'FP' prefix and immediate values are properly constructed using f32().
2024-12-31shader_recompiler: Implement ISBERD instructionZephyron
Implements the Internal Stage Buffer Entry Read (ISBERD) instruction in the Maxwell shader recompiler. This replaces the previous stubbed implementation with actual buffer reading functionality. The implementation: - Validates unsupported features (skew, o, mode, shift) - Performs buffer read using IR::InternalStageBufferRead - Stores the read value to the destination register This removes the "(STUBBED) called" warning messages that were previously being logged during shader compilation.
2024-12-31shader_recompiler: Implement ISBERD instruction modes and shiftsZephyron
Implements the ISBERD (Internal Stage Buffer Entry Read) instruction's mode and shift options that were previously throwing NotImplemented exceptions. This includes: - Patch mode for reading patch data - Prim mode for reading primitive data - Attr mode for reading attribute data - U16 shift for 16-bit unsigned values - B32 shift for 32-bit values The implementation follows Maxwell's ISA specification for handling different buffer read modes and data shifts.
2024-12-31chore: update project references and add Citron copyrightZephyron
- Replaced all references to the old project name with Citron. - Added Citron copyright information alongside existing notices in all files.
2024-02-22Merge pull request #13075 from liamwhite/mali-having-a-bad-timeNarr the Reg
shader_recompiler: throw on missing geometry streams in geometry shaders
2024-02-19shader_recompiler: throw on missing geometry streams in geometry shadersLiam
2024-02-15shader_recompiler: fix non-const offset for arrayed image typesLiam
2024-02-15Revert "shader_recompiler: use only ConstOffset for OpImageFetch"Liam
This reverts commit f296a9ce9a1a144d322d54d4628dba6f8a800cb7.
2024-02-05shader_recompiler: use only ConstOffset for OpImageFetchLiam
2024-01-18Merge pull request #12644 from liamwhite/vkspec-image-offsetliamwhite
shader_recompiler: fix Offset operand usage for non-OpImage*Gather
2024-01-16Merge remote-tracking branch 'origin/master' into typos3Viktor Szépe
2024-01-15Fix more typosViktor Szépe
2024-01-11shader_recompiler: emulate 8-bit and 16-bit storage writes with cas loopLiam
2024-01-11shader_recompiler: fix Offset operand usage for non-OpImage*GatherLiam
2024-01-07Fix "Propietary" typo elsewhereViktor Szépe
2024-01-04Merge pull request #12437 from ameerj/gl-amd-fixesliamwhite
OpenGL: Fixes and workaround updates for AMD
2023-12-26shader_recompiler: use default value for clip distances arrayLiam
2023-12-26shader_recompiler: respect clip distance limits in indexed storeLiam
2023-12-22Merge pull request #12435 from liamwhite/type-checkFernando S
shader_recompiler: ensure derivatives for textureGrad are f32
2023-12-21spirv_emit_context: Fix BaseInstance for OGL spirvAmeer J
2023-12-21shader_recompiler: ensure derivatives for textureGrad are f32Liam
2023-12-21shader_recompiler: use float image operations on load/store when requiredLiam
2023-12-20emit_glsl_image: Use inlined texelFetch offsetsAmeer J
2023-12-18shader_recompiler: use minimal clip distance arrayLiam
2023-12-18shader_recompiler: ignore clip distances beyond driver support levelLiam
2023-12-03Merge pull request #12196 from ameerj/glsl-cbuf-sizesliamwhite
GLSL: Use known cbuf sizes when possible
2023-11-26GLSL: Prefer known used cbuf sizesAmeer J
2023-11-26Merge branch 'master' into ssbo-alignAmeer J
2023-11-19renderer_vulkan: ignore viewport stores on non-supporting driversLiam
2023-11-19Merge pull request #12066 from ameerj/nvidia-nsanityliamwhite
shader_recompiler: add byteswap pattern workaround for Nvidia
2023-11-18shader_recompiler: Fix spelling of "derivate" (#12067)Ameer J
2023-11-17shader_recompiler: add byteswap pattern workaround for NvidiaAmeer J
2023-10-31shader_recompiler: Align SSBO offsets in GlobalMemory functionsAmeer J
2023-10-31shader_recompiler: Align SSBO offsets to meet host requirementsAmeer J
Co-Authored-By: Billy Laws <blaws05@gmail.com>
2023-10-23Merge pull request #11847 from ameerj/glsl-shfl-fixliamwhite
emit_glsl_warp: Fix shfl_in_bounds conditional
2023-10-22emit_glsl_warp: Fix shfl_in_bounds conditionalAmeer J
2023-10-19Manually robust on Maxwell and earlierKelebek1
2023-10-02ci: fix new codespell errorsLiam
2023-09-22emit_spirv: fix incorrect use of descriptor index in image atomicsLiam
2023-09-14shader_recompiler: skip sampler for buffer textures (#11435)liamwhite