Skip to content

Commit

Permalink
Extended the async pipeline pattern to two more sets of long running …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
toji committed Nov 2, 2023
1 parent 774e392 commit c17c672
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/webgpu/shader/execution/robust_access.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ const kMinI32 = -0x8000_0000;
* Non-test bindings are in bind group 1, including:
* - `constants.zero`: a dynamically-uniform `0u` value.
*/
function runShaderTest(
async function runShaderTest(
t: GPUTest,
stage: GPUShaderStageFlags,
testSource: string,
layout: GPUPipelineLayout,
testBindings: GPUBindGroupEntry[],
dynamicOffsets?: number[]
): void {
): Promise<void> {
assert(stage === GPUShaderStage.COMPUTE, 'Only know how to deal with compute for now');

// Contains just zero (for now).
Expand Down Expand Up @@ -62,7 +62,7 @@ fn main() {

t.debug(source);
const module = t.device.createShaderModule({ code: source });
const pipeline = t.device.createComputePipeline({
const pipeline = await t.device.createComputePipelineAsync({
layout,
compute: { module, entryPoint: 'main' },
});
Expand Down Expand Up @@ -172,7 +172,7 @@ g.test('linear_memory')
.expand('baseType', supportedScalarTypes)
.expandWithParams(generateTypes)
)
.fn(t => {
.fn(async t => {
const {
addressSpace,
storageMode,
Expand Down Expand Up @@ -448,7 +448,7 @@ fn runTest() -> u32 {
);

// Run the shader, accessing the buffer.
runShaderTest(
await runShaderTest(
t,
GPUShaderStage.COMPUTE,
testSource,
Expand All @@ -475,6 +475,6 @@ fn runTest() -> u32 {
bufferBindingEnd
);
} else {
runShaderTest(t, GPUShaderStage.COMPUTE, testSource, layout, []);
await runShaderTest(t, GPUShaderStage.COMPUTE, testSource, layout, []);
}
});
6 changes: 3 additions & 3 deletions src/webgpu/shader/execution/zero_init.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ g.test('compute,zero_init')
})
)
.batch(15)
.fn(t => {
.fn(async t => {
const { workgroupSize } = t.params;
const { maxComputeInvocationsPerWorkgroup } = t.device.limits;
const numWorkgroupInvocations = workgroupSize.reduce((a, b) => a * b);
Expand Down Expand Up @@ -446,7 +446,7 @@ g.test('compute,zero_init')
],
});

const fillPipeline = t.device.createComputePipeline({
const fillPipeline = await t.device.createComputePipelineAsync({
layout: t.device.createPipelineLayout({ bindGroupLayouts: [fillLayout] }),
label: 'Workgroup Fill Pipeline',
compute: {
Expand Down Expand Up @@ -495,7 +495,7 @@ g.test('compute,zero_init')
t.queue.submit([e.finish()]);
}

const pipeline = t.device.createComputePipeline({
const pipeline = await t.device.createComputePipelineAsync({
layout: 'auto',
compute: {
module: t.device.createShaderModule({
Expand Down

0 comments on commit c17c672

Please sign in to comment.