Use the resolved pixel format (IsPixelFormatInteger/SignedInteger)
instead of checking individual TIC component type fields to determine
SamplerComponentType. Inspecting r_type/g_type/b_type/a_type individually
can misclassify textures when unused channels have arbitrary type values
(e.g., BCn compressed or single-channel formats), causing a mismatch
between the SPIR-V image sampled type and the Vulkan image view format
that leads to transparency artifacts on rendered objects.
Signed-off-by: Zephyron <zephyron@citron-emu.org>
revert Merge pull request 'vk_pipeline_cache: Fix unbounded memory growth during shader compilation' (#134) from fix-unbounded-memory into main
Reviewed-on: https://git.citron-emu.org/Citron/Emulator/pulls/134
Needs proper testing, will crash games instead of properly clean
revert fix(vulkan): Async Presentation & Shader Logic
- Fix race condition in PipelineCache and ShaderPools using std::mutex.
- Fix stutter in Asynchronous Shader Building by properly returning nullptr for unbuilt pipelines (pop-in behavior).
- Modify AcquireNextImage to use MasterSemaphore for safer async presentation.
Needs more testing.
- Fix race condition in PipelineCache and ShaderPools using std::mutex.
- Fix stutter in Asynchronous Shader Building by properly returning nullptr for unbuilt pipelines (pop-in behavior).
- Modify AcquireNextImage to use MasterSemaphore for safer async presentation.
Update texture descriptor comparison to include component_type, ensuring
textures with different component types are properly differentiated.
- Add ReadTextureComponentType helper function
- Include component_type in texture descriptor comparison
- Use component type when creating texture descriptors
Co-Authored-By: ForrestMarkX <forrestmarkx@outlook.com>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Implement texture component type conversion and caching in shader
environments, with full serialization support for shader cache.
- Add ConvertSamplerComponentType using std::bitset for component tracking
- Implement ReadTextureComponentType for Graphics/Compute/File environments
- Add texture_component_types cache to all environment classes
- Update Serialize/Deserialize to include component types
- Cache component types alongside texture types for performance
Co-Authored-By: ForrestMarkX <forrestmarkx@outlook.com>
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Update SPIR-V backend to use component-specific sampled types for
textures, ensuring correct type conversions for integer and depth/stencil
textures.
- Add ComponentScalarType helper function
- Update ImageType to accept component-specific sampled types
- Add TextureColorResultType and TextureSampleResultToFloat helpers
- Update all texture sampling functions to handle component types
- Add output_s32 for signed integer outputs
- Add Flat decorations for integer inputs in fragment shaders
- Add NonWritable decoration for read-only storage buffers
Co-Authored-By: ForrestMarkX <forrestmarkx@outlook.com>
Signed-off-by: Zephyron <zephyron@citron-emu.org>