From 2101ec529d6bbc88bad909c8fbca8cfc91a2ff30 Mon Sep 17 00:00:00 2001 From: Kai Ninomiya Date: Mon, 10 Jun 2024 10:49:51 -0700 Subject: [PATCH] Revert "Update validation tests for 3D textures with BC compression (#3777)" (#3786) --- src/webgpu/api/validation/createTexture.spec.ts | 12 ++++-------- src/webgpu/format_info.ts | 17 ++++++----------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/webgpu/api/validation/createTexture.spec.ts b/src/webgpu/api/validation/createTexture.spec.ts index 08ef8c364954..fc1c8b86b26b 100644 --- a/src/webgpu/api/validation/createTexture.spec.ts +++ b/src/webgpu/api/validation/createTexture.spec.ts @@ -101,8 +101,7 @@ g.test('zero_size_and_usage') g.test('dimension_type_and_format_compatibility') .desc( - `Test every dimension type on every format. Depth/stencil formats only support 2d; - compressed formats support either 2d or 2d+3d.` + `Test every dimension type on every format. Note that compressed formats and depth/stencil formats are not valid for 1D/3D dimension types.` ) .params(u => u // @@ -221,6 +220,7 @@ g.test('mipLevelCount,bound_check') ({ format, size, dimension }) => format === 'bc1-rgba-unorm' && (dimension === '1d' || + dimension === '3d' || size[0] % kTextureFormatInfo[format].blockWidth !== 0 || size[1] % kTextureFormatInfo[format].blockHeight !== 0) ) @@ -459,8 +459,8 @@ g.test('texture_size,default_value_and_smallest_size,compressed_format') ) .params(u => u - // Compressed formats are invalid for 1D. - .combine('dimension', [undefined, '2d', '3d'] as const) + // Compressed formats are invalid for 1D and 3D. + .combine('dimension', [undefined, '2d'] as const) .combine('format', kCompressedTextureFormats) .beginSubcases() .expandWithParams(p => { @@ -474,10 +474,6 @@ g.test('texture_size,default_value_and_smallest_size,compressed_format') { size: [blockWidth, blockHeight, 1], _success: true }, ]; }) - // Filter if the dimension is 3D and format is not compatible - .unless( - ({ dimension, format }) => dimension === '3d' && !kTextureFormatInfo[format].texture3D - ) ) .beforeAllSubcases(t => { const { format } = t.params; diff --git a/src/webgpu/format_info.ts b/src/webgpu/format_info.ts index 1b4d3eb4575c..be1320d3cdad 100644 --- a/src/webgpu/format_info.ts +++ b/src/webgpu/format_info.ts @@ -30,8 +30,6 @@ const kFormatUniversalDefaults = { feature: undefined, /** The base format for srgb formats. Specified on both srgb and equivalent non-srgb formats. */ baseFormat: undefined, - /** Whether the format can be used in textures with 3D dimension. */ - texture3D: undefined, /** @deprecated Use `.color.bytes`, `.depth.bytes`, or `.stencil.bytes`. */ bytesPerBlock: undefined, @@ -70,7 +68,7 @@ function formatTableWithDefaults 1 || info.depth || info.stencil)) && - !(dimension === '3d' && !info.texture3D) + return !( + (dimension === '1d' || dimension === '3d') && + (info.blockWidth > 1 || info.depth || info.stencil) ); }