Skip to content

Allow empty bindGroupLayouts in GPUPipelineLayoutDescriptor - #4946

Merged
kainino0x merged 4 commits into
mainfrom
holes
Nov 1, 2024
Merged

kainino0x merged 4 commits into
mainfrom
holes

Conversation

@beaufortfrancois

Copy link
Copy Markdown
Contributor

FIX #2043

@github-actions

github-actions Bot commented Oct 31, 2024 •

Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (b844f51):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

Comment thread spec/index.bs Resolved
Comment thread spec/index.bs Resolved
Comment thread spec/index.bs Resolved
Comment thread spec/index.bs Resolved
@kainino0x kainino0x added this to the Milestone 2 milestone Nov 1, 2024
@kainino0x kainino0x modified the milestones: Milestone 2, Milestone 1 Nov 1, 2024
@kainino0x

Copy link
Copy Markdown
Contributor

I created a milestone-0 branch which we'll use for the first CR snapshot. With that I think this can land in main.

@kainino0x kainino0x added api resolved Resolved - waiting for a change to the API specification api WebGPU API needs-cts-issue This change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet labels Nov 1, 2024
@kainino0x
kainino0x merged commit eea67b5 into main Nov 1, 2024
@kainino0x
kainino0x deleted the holes branch November 1, 2024 23:45
Comment thread spec/index.bs
1. Let |limits| be |this|.{{GPUObjectBase/[[device]]}}.{{device/[[limits]]}}.
1. Let |bindGroupLayouts| be a copy of |descriptor|.{{GPUPipelineLayoutDescriptor/bindGroupLayouts}}
1. For each |i| in the [=list/get the indices|indices=] of |bindGroupLayouts|:
1. If |bindGroupLayouts|[|i|] is `undefined` or [=list/empty=], set |bindGroupLayouts|[|i|] to `null`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kainino0x I've just realized |bindGroupLayouts|[|i|] is [=list/empty=] is actually not defined in the spec as https://gpuweb.github.io/gpuweb/#gpubindgrouplayout is not a list per say. We obviously mean empty is a bind group layout with 0 entries but we may want to actually define this. WDYT?

@kainino0x kainino0x Nov 6, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch, yes, we should say something like If |bindGroupLayouts|[|i|] is `undefined` or |bindGroupLayouts|[|i|].{{GPUBindGroupLayout/[[descriptor]]}}.{{GPUBindGroupLayoutDescriptor/entries}} is [=list/empty=]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's #4958

mergify Bot pushed a commit to LTplus-AG/ifc-lite that referenced this pull request Nov 6, 2026
…ot (#9060) (#9065)

* fix(renderer): bind an empty group at every padded pipeline-layout slot (#9060)

withSectionExclusions pads layouts with empty bind group layouts so the section-exclusion table sits at group 3. WebGPU before gpuweb/gpuweb#4946 still requires a bound group at every layout slot, so the main pass failed every frame with 'No bind group set at group index 2' and no model appeared. The main, instanced, glass, shadow, pick and selection-mask passes and OpaqueVisibilityPass now bind a shared empty group at each padded slot.

Co-authored-by: Copilot <[email protected]>

* test(renderer): every padded layout slot is bound before a draw (#9060)

Strict pre-gpuweb#4946 slot check for withSectionExclusions + bindSectionExclusions, group 2 at every OpaqueVisibilityPass draw (perspective, geometric depth, non-variant after variant), and the real render() loop binding group 2 after the sky and before geometry. The visibility and render-path tests fail without the fix.

Co-authored-by: Copilot <[email protected]>

* fix(renderer): bind the visibility group at draw time in resumed passes (#9060)

A deferred transparent instanced draw replays its pipeline, then bindSectionExclusions(pass, device, 2), then the draw. resume() bound slot 2 only on setPipeline, so in an orthographic Gaussian split frame the replayed padding bind replaced the geometric-depth group and the variant draw failed validation. resume() now decides slot 2 per draw from the current pipeline, as begin() does.

* test(renderer): a replayed padding bind cannot hide the visibility group from a resumed draw (#9060)

Variant draw after pipeline + padding bind sees the visibility group; a non-variant draw gets the padding. Fails against the setPipeline-only resume().

---------

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api resolved Resolved - waiting for a change to the API specification api WebGPU API needs-cts-issue This change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dealing with holes in the pipeline layout.

3 participants