Add some comments relating create_texture validation to the spec (#8569)

Fixes #8568
This commit is contained in:
Andy Leiserson authored and GitHub committed 2025-11-26 18:17:47 +01:00
1 parent 7985f571be
commit 0cd4d31d45
2 files changed
+16

No files matched your search

+11
View File
@@ -199,6 +199,17 @@ pub fn map_texture_usage_from_hal(uses: wgt::TextureUses) -> wgt::TextureUsages
u
}
/// Check the requested texture size against the supported limits.
///
/// This function implements the texture size and sample count checks in [vtd
/// dimension step]. The format checks are elsewhere in [`create_texture`]`.
///
/// Note that while there is some basic checking of the sample count here, there
/// is an additional set of checks when `sample_count > 1` elsewhere in
/// [`create_texture`]`.
///
/// [vtd dimension step]: https://www.w3.org/TR/2025/CRD-webgpu-20251120/#:~:text=or%204.-,If%20descriptor.dimension%20is
/// [`create_texture`]: crate::device::Device::create_texture
pub fn check_texture_dimension_size(
dimension: wgt::TextureDimension,
wgt::Extent3d {
+5
View File
@@ -1424,6 +1424,11 @@ impl Device {
.map_err(|error| CreateTextureError::MissingFeatures(desc.format, error))?;
if desc.sample_count > 1 {
// <https://www.w3.org/TR/2025/CRD-webgpu-20251120/#:~:text=If%20descriptor%2EsampleCount%20%3E%201>
//
// Note that there are also some checks related to the sample count
// in [`conv::check_texture_dimension_size`].
if desc.mip_level_count != 1 {
return Err(CreateTextureError::InvalidMipLevelCount {
requested: desc.mip_level_count,