From 975839c060fb6cc79bb89e7e5b971c1c8deb8000 Mon Sep 17 00:00:00 2001 From: Greggman Date: Mon, 16 Dec 2024 23:35:33 -0800 Subject: [PATCH] Compat: make texture_view:write handle 0 storage textures (#4100) --- src/webgpu/api/operation/texture_view/write.spec.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/webgpu/api/operation/texture_view/write.spec.ts b/src/webgpu/api/operation/texture_view/write.spec.ts index aa41e7e176ea..def117470539 100644 --- a/src/webgpu/api/operation/texture_view/write.spec.ts +++ b/src/webgpu/api/operation/texture_view/write.spec.ts @@ -22,11 +22,11 @@ import { kTextureFormatInfo, RegularTextureFormat, } from '../../../format_info.js'; -import { GPUTest, TextureTestMixin } from '../../../gpu_test.js'; +import { GPUTest, MaxLimitsTestMixin, TextureTestMixin } from '../../../gpu_test.js'; import { kFullscreenQuadVertexShaderCode } from '../../../util/shader.js'; import { TexelView } from '../../../util/texture/texel_view.js'; -export const g = makeTestGroup(TextureTestMixin(GPUTest)); +export const g = makeTestGroup(TextureTestMixin(MaxLimitsTestMixin(GPUTest))); const kTextureViewWriteMethods = [ 'storage-write-fragment', @@ -355,6 +355,13 @@ TODO: Test rgb10a2uint when TexelRepresentation.numericRange is made per-compone .fn(t => { const { format, method, sampleCount, viewUsageMethod } = t.params; + t.skipIf( + t.isCompatibility && + method === 'storage-write-fragment' && + !(t.device.limits.maxStorageBuffersInFragmentStage! > 0), + `maxStorageBuffersInFragmentStage(${t.device.limits.maxStorageBuffersInFragmentStage}) < 1` + ); + const textureUsageForMethod = method.includes('storage') ? GPUTextureUsage.STORAGE_BINDING : GPUTextureUsage.RENDER_ATTACHMENT;