Add CRT (Cathode Ray Tube) shader implementation as scaling filter
options (CRT EasyMode and CRT Royale) in the Window Adapting Filter
dropdown. Provides classic TV effects including scanlines, phosphor
masks, curvature distortion, gamma correction, bloom, brightness, and
alpha transparency.
- Add CRTEasyMode and CRTRoyale to ScalingFilter enum
- Implement vulkan_crt_easymode.frag shader with single-pass effects
- Integrate CRT filter into WindowAdaptPass rendering pipeline
- Add configurable CRT parameters to settings with user-friendly labels
- Add UI translations for desktop and Android platforms
- Support CRT push constants in present pipeline
The CRT filter appears alongside other scaling filters like FSR and
FSR 2.0. CRT parameter settings are only active when a CRT filter
is selected.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Add block_linear_unswizzle_3d_bcn.comp compute shader for BCn format support
- Update host shaders CMakeLists to include new shader
This adds a new compute shader for BCn format handling.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
needs a branch with more work to be done, partial inlining that is invisible to performance (5kb which is nothing), PGO + BOLT optimization path yielding better results regardless
Force inlining of the ExecuteCommand function to reduce CPU overhead in the GPU command processing hot path. Additionally, silence debug logging metadata within the function to prevent string-processing logic from blocking compiler optimizations. Includes safe guards for multi-compiler and cross-platform compatibility.
Signed-off-by: Collecting <collecting@noreply.localhost>
Adds comprehensive support for ETC2 compressed texture formats (ETC2_RGB,
ETC2_RGBA, ETC2_RGB_PTA) in both UNORM and SRGB variants. This addresses
rendering issues in games like Hogwarts Legacy that use these formats.
Changes:
- Add ETC2 texture format enums (TextureFormat::ETC2_RGB_SRGB,
ETC2_RGBA_SRGB) and component types (SNORM_FORCE_FP16, UNORM_FORCE_FP16)
- Implement format lookup mappings for all ETC2 variants in
format_lookup_table.cpp
- Add PixelFormat enum values and block size tables for ETC2 formats
- Integrate ETC2 support into Vulkan backend with proper VkFormat mappings
- Add IsOptimalEtc2Supported() device capability check
- Update texture cache to handle ETC2 format conversion when needed
- Add ETC2 format cases to PixelFormat formatter for logging
- Improve shader environment texture handle validation with graceful
fallback for invalid handles
Fixes assertion failures for texture formats 90 and 99, enabling proper
rendering of ETC2 compressed textures using native Vulkan support.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Remove strict assertion on data_transfer_type and allow PIPELINED
transfers (treating them as NON_PIPELINED). Some games like Marvel
Cosmic Invasion use pipelined transfers, causing crashes.
Fixes assertion at maxwell_dma.cpp:76
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Force shadow maps to use CLAMP_TO_BORDER with white border color
- Convert CLAMP_TO_EDGE to CLAMP_TO_BORDER for shadow maps
- Improve GL_CLAMP handling for shadow maps on AMD
Issue may persist - likely needs investigation of shadow map rendering
or shader coordinate generation.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Fix UNIMPLEMENTED assertion when handling GPU-modified ignored textures
in texture cache. When ignored textures (remapped or same address/size)
have GpuModified flag set, now properly copies data to new image if
formats match, or marks new image as modified otherwise.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Switch to Ryujinx MoltenVK build compiled with older Metal SDK to avoid
MSL 3.2 thread_scope_subgroup bugs that cause text rendering issues
- Exclude Apple from GNU ld.bfd linker option (macOS uses different linker)
- Handle VK_ERROR_FRAGMENTED_POOL in Vulkan descriptor pool allocation
revert refactor(vulkan): Remove redundant query cache segment notifications
- Remove NotifySegment(true) from PrepareDraw, DrawTexture, and Clear
- Remove NotifySegment(false) from AccelerateDisplay
- Add state tracking for transform feedback to avoid redundant CounterEnable calls
- Only call CounterEnable when transform feedback enable state changes
This prevents double resume/pause operations and state management conflicts.
Co-authored-by: Maufeat <maufeat@eden-emu.dev>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
When viewport_scale_offset_enabled is false, properly set all viewports
using surface_clip dimensions instead of just one. This prevents vertex
explosions caused by invalid or zero-sized viewports.
- Set all viewports (Maxwell::NumViewports) when transformations disabled
- Ensure minimum viewport dimensions (1.0f) to prevent zero-sized viewports
- Respect device viewport limits when setting viewports
- Use proper viewport array instead of single viewport
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Remove NotifySegment(true) from PrepareDraw, DrawTexture, and Clear
- Remove NotifySegment(false) from AccelerateDisplay
- Add state tracking for transform feedback to avoid redundant CounterEnable calls
- Only call CounterEnable when transform feedback enable state changes
This prevents double resume/pause operations and state management conflicts.
Co-authored-by: Maufeat <maufeat@eden-emu.dev>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Filter blend factors: replace DestAlpha with One and OneMinusDestAlpha
with Zero for RGBX formats
- Disable alpha component in color write mask for RGBX formats
- Always use actual depth test function instead of defaulting when disabled
- Add FormatHasNoAlpha helper to detect RGBX formats
- Add FilterBlendFactor helper to adjust blend factors for RGBX formats
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Only warn when dimension differences exceed 16 pixels to avoid noise
from common codec alignment padding (e.g., 1088 vs 1080).
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Adds support for wrap mode 7 (MirrorOnceClampOGL) in the Vulkan renderer's
WrapMode function. This mode is mapped to VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE
as Vulkan doesn't have a direct equivalent to OpenGL's GL_MIRROR_CLAMP.
Fixes assertion failure: "Unimplemented wrap mode=7"
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- 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>
Fixes crashes when games/mods request more than MAX_MIP_LEVELS (14).
Implements defensive clamping at four critical points in the texture
cache (CalculateLevelSizes, CalculateMipLevelOffsets,
CalculateMipLevelSizes, CalculateLevelBytes) to gracefully handle
excessive mip level requests.
When >14 mip levels are requested:
- Logs informative warning (debug builds)
- Clamps to MAX_MIP_LEVELS
- Continues execution safely
This improves upon Eden's solution by adding actual bounds checking
instead of just converting ASSERT to ASSERT_MSG.
Fixes: CTGP-DX (Mario Kart 8 Deluxe mod)
Co-authored-by: JPikachu <jpikachu.eden@gmail.com>
Co-authored-by: JPikachu <jpikachu@eden-emu.dev>
Co-authored-by: MaranBr <maranbr@outlook.com>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Add configurable EDS levels (Disabled/EDS1/EDS2/EDS3) to allow users to
troubleshoot graphics issues by controlling which Vulkan Extended Dynamic
State features are enabled. Defaults to EDS3 for maximum performance.
Implements setting in both desktop and Android frontends with proper
translations and descriptions.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Adds user option to disable Vulkan conditional rendering, which can fix
flickering objects in some games caused by rapidly toggled draw calls.
Changes:
- Add use_conditional_rendering setting (default: enabled)
- Guard conditional rendering functions with setting check using [[unlikely]]
- Early exit in Pause/Resume and Compare functions when disabled
Disabling this in Graphics (Advanced) fixes flickering at cost of performance.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
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>
Implements ScaleFX algorithm for pixel art upscaling with edge
preservation. Supports both OpenGL and Vulkan with FP16/FP32
variants for hardware optimization.
ScaleFX is designed to reduce pixelation while preserving sharp
edges, ideal for low-resolution and pixel art games.
Signed-off-by: Zephyron <zephyron@citron-emu.org>