Skip to content

Commit

Permalink
Compat: update pipeline_bind_group_compat for 0 storage bufs/textures (
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman authored Dec 17, 2024
1 parent 42fca42 commit 71d7250
Showing 1 changed file with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
ValidBindableResource,
} from '../../../../capability_info.js';
import { GPUConst } from '../../../../constants.js';
import { MaxLimitsTestMixin } from '../../../../gpu_test.js';
import {
ProgrammableEncoderType,
kProgrammableEncoderTypes,
Expand Down Expand Up @@ -424,7 +425,7 @@ class F extends ValidationTest {
}
}

export const g = makeTestGroup(F);
export const g = makeTestGroup(MaxLimitsTestMixin(F));

g.test('bind_groups_and_pipeline_layout_mismatch')
.desc(
Expand Down Expand Up @@ -531,6 +532,13 @@ g.test('buffer_binding,render_pipeline')
.fn(t => {
const { type } = t.params;

t.skipIf(
(type === 'storage' || type === 'read-only-storage') &&
t.isCompatibility &&
!(t.device.limits.maxStorageBuffersInFragmentStage! > 1),
`maxStorageBuffersInFragmentStage(${t.device.limits.maxStorageBuffersInFragmentStage}) is not >= 1`
);

// Create fixed bindGroup
const uniformBuffer = t.getUniformBuffer();

Expand Down Expand Up @@ -748,6 +756,18 @@ g.test('bgl_visibility_mismatch')
);
});

function resourceIsStorageTexture(resourceType: ValidBindableResource) {
return (
resourceType === 'readonlyStorageTex' ||
resourceType === 'readwriteStorageTex' ||
resourceType === 'writeonlyStorageTex'
);
}

function resourceIsStorageBuffer(resourceType: ValidBindableResource) {
return resourceType === 'storageBuf';
}

g.test('bgl_resource_type_mismatch')
.desc(
`
Expand All @@ -766,6 +786,20 @@ g.test('bgl_resource_type_mismatch')
const { encoderType, call, callWithZero, bgResourceType, plResourceType, useU32Array } =
t.params;

t.skipIf(
t.isCompatibility &&
resourceIsStorageTexture(plResourceType) &&
!(t.device.limits.maxStorageTexturesInFragmentStage! >= 1),
`maxStorageTexturesInFragmentStage(${t.device.limits.maxStorageTexturesInFragmentStage}) is not >= 1`
);

t.skipIf(
t.isCompatibility &&
resourceIsStorageBuffer(plResourceType) &&
!(t.device.limits.maxStorageBuffersInFragmentStage! >= 1),
`maxStorageBuffersInFragmentStage(${t.device.limits.maxStorageBuffersInFragmentStage}) is not >= 1`
);

const bglEntries: Array<GPUBindGroupLayoutEntry> = [
t.createBindGroupLayoutEntry(encoderType, bgResourceType, useU32Array),
];
Expand Down

0 comments on commit 71d7250

Please sign in to comment.