revert fix(shader): Fix integer texture format mismatch in SPIR-V
- Add is_integer field to TextureDescriptor and TextureDefinition
- Use IsTexturePixelFormatInteger to detect integer textures
- Update ImageType to use U32[1] for integer textures, F32[1] for float
- Merge is_integer flag when combining texture descriptors
Signed-off-by: Zephyron <zephyron@citron-emu.org>
revert fix(video): handle invalid texture format in format lookup table
Return default pixel format for uninitialized texture descriptors
(format=0, components=0) instead of asserting. Prevents crashes when
texture cache encounters uninitialized texture data.
Fixes assertion failures in format_lookup_table.cpp:250.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
revert fix(vulkan): Fix viewport handling when transformations are disabled
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>
revert fix(nvdrv): prevent infinite loop when SMMU address space is exhausted
Fix crash in PinHandle when SMMU allocation fails and unmap queue is empty.
Previously, the code would log an error and continue looping indefinitely,
causing log spam and eventual crash. Now it returns 0 to fail gracefully.
Also fix incorrect handle check on line 219 - should check freeHandleDesc
instead of handle_description.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
revert fix(nvdrv): prevent infinite loop and improve error handling when SMMU address space is exhausted
Fix crash in PinHandle when SMMU allocation fails and unmap queue is empty.
Previously, the code would log an error and continue looping indefinitely,
causing log spam and eventual crash.
- Free multiple handles from unmap queue (up to 100) before giving up
- Add maximum attempt counter to prevent infinite loops
- Return 0 gracefully when no more handles can be freed
- Add error handling in callers (Remap, MapBufferEx, MapBuffer) to check for
PinHandle failure and return NvResult::InsufficientMemory instead of using
invalid addresses
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Moved the copy buffer to the heap via std::make_unique.
- Added explicit null-safety and system shutdown checks to mirroring logic.
- Hardened recursion guards during directory traversal to ensure stability.
Signed-off-by: Collecting <collecting@noreply.localhost>
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>
- Update texture descriptor comparison to include component_type
- Add ReadTextureComponentType helper in texture_pass.cpp
- Use component type when creating texture descriptors
This ensures texture descriptors are properly differentiated by component type.
Co-Authored-By: ForrestMarkX <forrestmarkx@outlook.com>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Add ComponentScalarType helper function
- Update ImageType to use component-specific sampled types
- Add TextureColorResultType and TextureSampleResultToFloat helpers
- Update all texture sampling functions to handle component types correctly
- Add proper type conversions for integer and stencil textures
- Add Flat decorations for integer inputs in fragment shaders
- Add NonWritable decoration for read-only storage buffers
This ensures textures are sampled with the correct component types,
improving accuracy for integer and depth/stencil textures.
Co-Authored-By: ForrestMarkX <forrestmarkx@outlook.com>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
- Add SamplerComponentType enum to shader_info.h
- Add ReadTextureComponentType to Environment interface
- Add texture_component_types cache to shader environments
- Update texture descriptor to include component_type field
This is the foundation for proper texture component type handling.
Co-Authored-By: ForrestMarkX <forrestmarkx@outlook.com>
Signed-off-by: Zephyron <zephyron@citron-emu.org>