Skip to content

Commit

Permalink
Compat: make texture_view:write handle 0 storage textures (#4100)
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman authored Dec 17, 2024
1 parent 64c1fa9 commit 975839c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/webgpu/api/operation/texture_view/write.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 975839c

Please sign in to comment.