Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compat: update pipeline_bind_group_compat for 0 storage bufs/textures #4095

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading