mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-13 14:48:32 +09:00
[Fix] (MG_Util, DirectVulkan): canonical depth shadows with upload conversion
Depth textures previously raw-copied whatever the client handed over into the Vulkan image, so any client format other than the image's exact texel layout uploaded garbage (float DEPTH_COMPONENT data read as 16-bit words, GL_TEXTURE_1D/2D alike). The shadow now has a defined canonical layout - unorm16 for DEPTH_COMPONENT16, a full-scale unorm32 word for the 24/32-bit fixed depths, float for DEPTH_COMPONENT32F - produced by the pixel-store unpack converter (new DepthComponent channel mapping + UNorm32 component). GL_DEPTH_COMPONENT client data may also fill packed depth-stencil internals (stencil half zero). The Vulkan uploader converts shadow words to the image texel layout per aspect, and X8_D24_UNORM falls back to D32_SFLOAT where optimal tiling lacks support (lavapipe). texture_size_promotion.functional and packed_depth_stencil.verify_copy_tex_image.* now pass.
This commit is contained in:
@@ -43,8 +43,11 @@ namespace MobileGL {
|
||||
case TextureInternalFormat::SRGB8:
|
||||
case TextureInternalFormat::RGB8I:
|
||||
case TextureInternalFormat::RGB8UI:
|
||||
case TextureInternalFormat::DepthComponent24:
|
||||
return 3;
|
||||
// Canonical depth shadow is a full 32-bit unorm word (see PixelStoreProcessor),
|
||||
// converted at upload to the image's own 24/32-bit layout.
|
||||
case TextureInternalFormat::DepthComponent24:
|
||||
return 4;
|
||||
|
||||
case TextureInternalFormat::RGBA2:
|
||||
case TextureInternalFormat::RGBA4:
|
||||
|
||||
Reference in New Issue
Block a user