Skip to content

Commit

Permalink
Add dummy targets to render pipelines (gpuweb#3807)
Browse files Browse the repository at this point in the history
Also allow manual dispatch of push workflow, useful for deployment of WIP branches.
  • Loading branch information
sagudev authored Jun 24, 2024
1 parent 9edf9d6 commit 4251e57
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Push CI

on:
workflow_dispatch:
push:
branches: [main]

Expand Down
16 changes: 16 additions & 0 deletions src/webgpu/api/operation/labels.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ const kTestFunctions: { [name: string]: TestFunction } = {
module,
entryPoint: 'foo',
},
// Specify a color attachment so we have at least one render target. Otherwise, details here
// are not relevant to this test.
fragment: {
targets: [{ format: 'rgba8unorm' }],
module: t.device.createShaderModule({
code: `@fragment fn main() -> @location(0) vec4f { return vec4f(0); }`,
}),
},
});
t.expect(renderPipeline.label === label);
},
Expand Down Expand Up @@ -143,6 +151,14 @@ const kTestFunctions: { [name: string]: TestFunction } = {
module,
entryPoint: 'foo',
},
// Specify a color attachment so we have at least one render target. Otherwise, details here
// are not relevant to this test.
fragment: {
targets: [{ format: 'rgba8unorm' }],
module: t.device.createShaderModule({
code: `@fragment fn main() -> @location(0) vec4f { return vec4f(0); }`,
}),
},
});
t.expect(renderPipeline.label === label);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,20 @@ export class LimitTestsImpl extends GPUTestBase {
}

_createRenderPipelineDescriptor(module: GPUShaderModule): GPURenderPipelineDescriptor {
const { device } = this;
return {
layout: 'auto',
vertex: {
module,
entryPoint: 'mainVS',
},
// Specify a color attachment so we have at least one render target.
fragment: {
targets: [{ format: 'rgba8unorm' }],
module: device.createShaderModule({
code: `@fragment fn main() -> @location(0) vec4f { return vec4f(0); }`,
}),
},
};
}

Expand Down
4 changes: 4 additions & 0 deletions src/webgpu/api/validation/render_pipeline/misc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ state (and thus has no color state), and can be created with or without depth st
'',
] as const)
.combine('hasColor', [false, true])
.unless(({ depthStencilFormat, hasColor }) => {
// Render pipeline needs at least one attachement
return hasColor === false && depthStencilFormat === '';
})
)
.fn(t => {
const { isAsync, depthStencilFormat, hasColor } = t.params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ g.test('invalid,vertex')
: t.createInvalidShaderModule(),
entryPoint: 'main',
},
// Specify a color attachment so we have at least one render target.
fragment: {
targets: [{ format: 'rgba8unorm' }],
module: t.device.createShaderModule({
code: `@fragment fn main() -> @location(0) vec4f { return vec4f(0); }`,
}),
},
});
});

Expand Down

0 comments on commit 4251e57

Please sign in to comment.