feat(shaders): Proper Component Type Handling w/ various types of textures #133

Merged
Collecting merged 6 commits from feat/shader-component-type-handling into main 2026-02-10 16:58:12 -05:00
Collaborator
  • Grabs result types for texture color sampling & also scalar ID's for proper formatting
  • Should resolve 90-95% of the black artifacting found in MP4
- Grabs result types for texture color sampling & also scalar ID's for proper formatting - Should resolve 90-95% of the black artifacting found in MP4
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 <[email protected]>
Signed-off-by: Zephyron <[email protected]>
Add SamplerComponentType enum to classify texture component types
(float, signed int, unsigned int, depth, stencil) and add
ReadTextureComponentType method to Environment interface.

- Add SamplerComponentType enum with constexpr helper functions
- Add component_type field to TextureDescriptor struct
- Add ReadTextureComponentType virtual method to Environment base class

Co-Authored-By: ForrestMarkX <[email protected]>
Signed-off-by: Zephyron <[email protected]>
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 <[email protected]>
Signed-off-by: Zephyron <[email protected]>
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 <[email protected]>
Signed-off-by: Zephyron <[email protected]>
Add block_linear_unswizzle_3d_bcn.comp compute shader for improved
BCn format support. The shader uses GLSL 460 and handles block-space
coordinate conversion for BCn compressed textures.

- Add block_linear_unswizzle_3d_bcn.comp shader
- Update host shaders CMakeLists to include new shader

Co-Authored-By: ForrestMarkX <[email protected]>
Signed-off-by: Zephyron <[email protected]>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Kintoki/Emulator!133
No description provided.