-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
This is a tracking issue for texture format misreporting.
This tracking issue is a WIP.
Testing
See #8646
Some testing is added in #8653, which is where many of these issues were found.
General
- Texture format R64Uint requires TEXTURE_INT64_ATOMIC #8662
- Bad error when TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES not enabled #8647
- Nonsensical texture format capabilities #8654 - instances of this are covered below. These have potential to be confusing and cause user errors but not to misreport capabilities
- P010 says "Features::TEXTURE_FORMAT_P010 must be enabled to use this texture format." However, it also requires
wgpu::Features::TEXTURE_FORMAT_16BIT_NORMwhich isn't documented anywhere to my knowledge - R16Unorm and friends have nonsensical capabilities on all backends, supporting multisample but not being a render attachment
Metal
Metal is especially bad. It is basically an attempt to copy down strange rules from a couple sources, including a huge table, which all change over time. Needless to say, there are about a billion bugs here.
See also #8594, which covers metal feature detection more broadly. #8439 fixes the crashes that could occur at adapter enumeration time, but leaves most of the texture format issues out.
Etc2Rgb8A1UnormSrgb format issue
Trying to create view with format Etc2Rgb8A1UnormSrgb on texture with format Etc2Rgb8A1Unorm and caps TextureFormatFeatures { allowed_usages: TextureUsages(COPY_SRC | COPY_DST | TEXTURE_BINDING), flags: TextureFormatFeatureFlags(FILTERABLE | BLENDABLE) }, and view format caps TextureFormatFeatures { allowed_usages: TextureUsages(COPY_SRC | COPY_DST | TEXTURE_BINDING), flags: TextureFormatFeatureFlags(FILTERABLE | BLENDABLE) }
_validateTextureView:745: failed assertion `Texture View Validation
texture usage (0x01) doesn't specify MTLTextureUsagePixelFormatView (0x10)
Vulkan
Misreported capabilities are SUPER common here. For example:
General
Format Rgb9e5Ufloat supports multisample but doesn't support being a render attachment, with caps TextureFormatFeatures { allowed_usages: TextureUsages(COPY_SRC | COPY_DST | TEXTURE_BINDING), flags: TextureFormatFeatureFlags(FILTERABLE | MULTISAMPLE_X4 | MULTISAMPLE_RESOLVE) }
R64Uint
Creating texture with format R64Uint and caps TextureFormatFeatures { allowed_usages: TextureUsages(COPY_SRC | COPY_DST | TEXTURE_BINDING | STORAGE_BINDING), flags: TextureFormatFeatureFlags(STORAGE_READ_ONLY | STORAGE_WRITE_ONLY) }
[2025-12-05T20:26:28Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-VkImageCreateInfo-imageCreateMaxMipLevels-02251 (0xbebcae79)]
vkCreateImage(): The following VkImageCreateInfo returned VK_ERROR_FORMAT_NOT_SUPPORTED when calling vkGetPhysicalDeviceImageFormatProperties2
format (VK_FORMAT_R64_UINT)
type (VK_IMAGE_TYPE_2D)
tiling (VK_IMAGE_TILING_OPTIMAL)
usage (VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_TRANSFER_DST_BIT|VK_IMAGE_USAGE_SAMPLED_BIT|VK_IMAGE_USAGE_STORAGE_BIT)
flags (VkImageCreateFlags(0))
VkImageCreateInfo::pNext is NULL.
The Vulkan spec states: Each of the following values (as described in Image Creation Limits) must not be undefined : imageCreateMaxMipLevels, imageCreateMaxArrayLayers, imageCreateMaxExtent, and imageCreateSampleCounts (https://vulkan.lunarg.com/doc/view/1.4.328.1/linux/antora/spec/latest/chapters/resources.html#VUID-VkImageCreateInfo-imageCreateMaxMipLevels-02251)
NV12
Trying to create view with format NV12 on texture with format NV12 and caps TextureFormatFeatures { allowed_usages: TextureUsages(TEXTURE_BINDING), flags: TextureFormatFeatureFlags(0x0) }, and view format caps TextureFormatFeatures { allowed_usages: TextureUsages(TEXTURE_BINDING), flags: TextureFormatFeatureFlags(0x0) }
[2025-12-05T20:26:27Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-VkImageViewCreateInfo-subresourceRange-07818 (0x3ffdd96b)]
vkCreateImageView(): pCreateInfo->subresourceRange.aspectMask (VK_IMAGE_ASPECT_PLANE_0_BIT|VK_IMAGE_ASPECT_PLANE_1_BIT) is invalid for VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
The Vulkan spec states: subresourceRange.aspectMask must only have at most 1 valid multi-planar aspect mask bit (https://vulkan.lunarg.com/doc/view/1.4.328.1/linux/antora/spec/latest/chapters/resources.html#VUID-VkImageViewCreateInfo-subresourceRange-07818)
GLES
R32Float "downlevel issue"
Creating texture with format R32Float and caps TextureFormatFeatures { allowed_usages: TextureUsages(COPY_SRC | COPY_DST | TEXTURE_BINDING | STORAGE_BINDING | RENDER_ATTACHMENT | TRANSIENT), flags: TextureFormatFeatureFlags(MULTISAMPLE_X4 | STORAGE_READ_ONLY | STORAGE_WRITE_ONLY | STORAGE_READ_WRITE) }
[2025-12-05T20:26:05Z ERROR wgpu::backend::wgpu_core] Handling wgpu errors as fatal by default
thread '<unnamed>' panicked at wgpu/src/backend/wgpu_core.rs:1607:26:
wgpu error: Validation Error
Caused by:
In Device::create_texture
Texture usages TextureUsages(RENDER_ATTACHMENT) are not allowed on a texture of type R32Float due to downlevel restrictions
Copy command encoding
Encoding copy
[2025-12-05T20:26:05Z INFO wgpu_core::device::global] Device::create_texture(TextureDescriptor { label: None, size: (64, 64, 32), mip_level_count: 1, sample_count: 1, dimension: D2, format: Depth32FloatStencil8, usage: TextureUsages(COPY_SRC | COPY_DST | TEXTURE_BINDING | RENDER_ATTACHMENT), view_formats: [Depth32FloatStencil8] }) -> Id(1,3)
[2025-12-05T20:26:05Z INFO wgpu_core::command::transfer] CommandEncoder::copy_texture_to_texture Id(0,4) -> Id(1,3) (64, 64, 1)
[2025-12-05T20:26:05Z INFO wgpu_core::device::global] Texture::drop Id(1,3)
[2025-12-05T20:26:05Z INFO wgpu_core::device::global] Texture::drop Id(0,4)
Attempting to record & submit command buffer
[2025-12-05T20:26:05Z INFO wgpu_core::device::global] CommandEncoder::drop Id(0,1)
[2025-12-05T20:26:05Z INFO wgpu_core::command] Drop CommandEncoder with '' label
[2025-12-05T20:26:05Z INFO wgpu_core::device::queue] Queue::submit
[2025-12-05T20:26:05Z WARN wgpu_hal::gles] GLES: [API/Other] ID 2 : FBO incomplete: depth attachment incomplete [-1]
[2025-12-05T20:26:05Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_FRAMEBUFFER_OPERATION in glClear(incomplete framebuffer)
[2025-12-05T20:26:05Z WARN wgpu_hal::gles] GLES: [API/Other] ID 2 : FBO incomplete: color attachment incomplete [0]
[2025-12-05T20:26:05Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_FRAMEBUFFER_OPERATION in glCopyTexSubImage2D(invalid readbuffer)
[2025-12-05T20:26:05Z WARN wgpu_hal::gles] GLES: [API/Other] ID 2 : FBO incomplete: color attachment incomplete [0]
[2025-12-05T20:26:05Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_FRAMEBUFFER_OPERATION in glCopyTexSubImage2D(invalid readbuffer)
[2025-12-05T20:26:05Z WARN wgpu_hal::gles] GLES: [API/Other] ID 2 : FBO incomplete: color attachment incomplete [0]
[2025-12-05T20:26:05Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_FRAMEBUFFER_OPERATION in glCopyTexSubImage2D(invalid readbuffer)
[2025-12-05T20:26:05Z WARN wgpu_hal::gles] GLES: [API/Other] ID 2 : FBO incomplete: color attachment incomplete [0]
[2025-12-05T20:26:05Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_FRAMEBUFFER_OPERATION in glCopyTexSubImage2D(invalid readbuffer)
[2025-12-05T20:26:05Z WARN wgpu_hal::gles] GLES: [API/Other] ID 2 : FBO incomplete: color attachment incomplete [0]
[2025-12-05T20:26:05Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_FRAMEBUFFER_OPERATION in glCopyTexSubImage3D(invalid readbuffer)
[2025-12-05T20:26:05Z WARN wgpu_hal::gles] GLES: [API/Other] ID 2 : FBO incomplete: color attachment incomplete [0]
[2025-12-05T20:26:05Z ERROR wgpu_hal::gles] GLES: [API/Error] ID 1 : GL_INVALID_FRAMEBUFFER_OPERATION in glCopyTexSubImage3D(invalid readbuffer)
This also gets spammed below that
[2025-12-05T20:26:04Z ERROR wgpu_test::expectations] Validation Error: GL_INVALID_FRAMEBUFFER_OPERATION in glCopyTexSubImage2D(invalid readbuffer)
These errors occur for many texture formats, not even exclusive to one family.
Bc7RgbaUnormSrgb issue
Creating texture with format Bc7RgbaUnormSrgb and caps TextureFormatFeatures { allowed_usages: TextureUsages(COPY_SRC | COPY_DST | TEXTURE_BINDING), flags: TextureFormatFeatureFlags(FILTERABLE | BLENDABLE) }
[2025-12-05T20:26:04Z INFO wgpu_core::device::global] Device::create_texture(TextureDescriptor { label: None, size: (64, 64, 32), mip_level_count: 1, sample_count: 1, dimension: D2, format: Bc7RgbaUnormSrgb, usage: TextureUsages(COPY_SRC | COPY_DST | TEXTURE_BINDING), view_formats: [Bc7RgbaUnormSrgb] }) -> Id(0,42)
[2025-12-05T20:26:04Z INFO wgpu_core::device::global] Texture::drop Id(0,42)
[2025-12-05T20:26:04Z INFO wgpu_core::resource] Destroy raw Texture with '' label
[2025-12-05T20:26:04Z INFO wgpu_core::device::global] CommandEncoder::drop Id(0,1)
[2025-12-05T20:26:04Z INFO wgpu_core::command] Drop CommandEncoder with '' label
[2025-12-05T20:26:04Z INFO wgpu_core::instance] Adapter::drop Id(0,1)
[2025-12-05T20:26:04Z INFO wgpu_core::device::global] Device::drop Id(0,1)
[2025-12-05T20:26:04Z INFO wgpu_core::device::global] Queue::drop Id(0,1)
[2025-12-05T20:26:04Z INFO wgpu_core::device::queue] Drop Queue with '' label
[2025-12-05T20:26:04Z INFO wgpu_core::device::queue] Waiting on last submission. try: 1/6. timeout: 100ms
[2025-12-05T20:26:04Z INFO wgpu_core::resource] Destroy raw StagingBuffer
[2025-12-05T20:26:04Z INFO wgpu_core::device::resource] Drop Device with '' label
[2025-12-05T20:26:04Z INFO wgpu_core::global] Global::drop
[2025-12-05T20:26:04Z ERROR wgpu_test::expectations] Validation Error: GL_INVALID_OPERATION in glTexStorage3D(internalformat = GL_COMPRESSED_RED_RGTC1)
[2025-12-05T20:26:04Z ERROR wgpu_test::expectations] Validation Error: GL_INVALID_OPERATION in glTexStorage3D(internalformat = GL_COMPRESSED_SIGNED_RED_RGTC1)
[2025-12-05T20:26:04Z ERROR wgpu_test::expectations] Validation Error: GL_INVALID_OPERATION in glTexStorage3D(internalformat = GL_COMPRESSED_RG_RGTC2)
[2025-12-05T20:26:04Z ERROR wgpu_test::expectations] Validation Error: GL_INVALID_OPERATION in glTexStorage3D(internalformat = GL_COMPRESSED_SIGNED_RG_RGTC2)
Invalid enum stuff
[2025-12-05T20:26:04Z ERROR wgpu_test::expectations] Validation Error: GL_INVALID_ENUM in glTexStorage2DMultisample(target=GL_TEXTURE_2D)
This gets spammed in some tests at the end after they panic for other reasons
DX12
Metadata
Metadata
Assignees
Labels
Type
Projects
Status