Sitelet https://github.com/gpuweb/gpuweb/pull/543
Skip to content

Add GPUPipelineBase.getBindGroupLayout. - #543

Merged
kainino0x merged 2 commits into
gpuweb:masterfrom
Kangz:getbindgrouplayout
May 7, 2020
Merged

kainino0x merged 2 commits into
gpuweb:masterfrom
Kangz:getbindgrouplayout

Conversation

@Kangz

@Kangz Kangz commented Jan 15, 2020 •

Copy link
Copy Markdown
Contributor

PTAL! I tried to make the algorithm for getBindGroupLayout as formal as possible but there's some hand-waviness because the spec doesn't have GPUShaderModule reflection yet.


Preview | Diff

@Kangz
Kangz requested review from JusSn, kainino0x and kvark January 15, 2020 15:04
Comment thread spec/index.bs
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated

@kainino0x kainino0x left a comment

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.

no further comments, but easy to read and lgtm

Comment thread spec/index.bs Outdated
@Kangz
Kangz force-pushed the getbindgrouplayout branch from aee44b1 to e96bd3e Compare April 21, 2020 13:59
@Kangz

Kangz commented Apr 21, 2020

Copy link
Copy Markdown
Contributor Author

I redid this completely and this was stalled for a long time, so I resolved all comments and let's start the review anew!

@kvark kvark left a comment

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.

Looks better now! A few more concerns/suggestions here.

Comment thread spec/index.bs Outdated
<dl dfn-type=attribute dfn-for="GPUPipelineLayout">
: <dfn>\[[bindGroupLayout]]</dfn> of type `sequence<GPUBindGroupLayout>`.
::
The layout of {{GPUBindGroup}}s that {{GPUPipelineBase}} using `this` will be compatible with.

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.

can we say something that BGL at sequence index i is expected at binding slot i, referring to set_bind_group from here to avoid confusion?

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.

Definitely thanks for looking into it in #724!

Comment thread spec/index.bs Outdated

1. Return a new error {{GPUBindGroupLayout}}.

1. Return a new {{GPUBindGroupLayout}} wrapping

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.

the |this|.{{GPUPipelineBase/[[layout]]}}.{{GPUPipelineLayout/[[bindGroupLayout]]}}[|index|] already has a type of GPUBindGroupLayout. What is the "wrapping" here?

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.

I wanted to say that a new JS object is created so that pipeline.getBindGroupLayout(i) always provide the same JS object but at the same time have it be unrelated to GPUBindGroupLayout objects passed in GPUPipelineLayoutDescriptor.bindGroupLayouts.

This is to avoid having to deal with what happens if you call getBindGroupLayout on valid vs. invalid pipeline that was created with an explicit pipeline layout. Since the error state is on the device timeline, we don't know it in the call to getBindGroupLayout that's in the content timeline, and can't know if we should return the same GPUBindGroupLayout that was passed explicitly via that GPUPipelineLayout (with its expando properties) or a new JS object that represents an error GPUBindGroupLayout.

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.

Ok, that makes sense.
Sounds like some clarification is needed in the spec itself. Maybe shorter, but just saying it's a "wrap" is not clear.

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.

I'm not 100% sure how to phrase that, I wanted to write a new {{GPUBindGroupLayout}} that references the same [=bind group layout=] as ... but [=object=] only exists for device and adapter. Is the plan to do it for all objects? +CC @kainino0x

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.

We can leave this as is and then fix it to say "new {{GPUBindGroupLayout}} that is [=group-equivalent=] to ..." after #724 lands

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.

Is the plan to do it for all objects? +CC @kainino0x

Yes (see "define texture (internal object)", "define buffer (internal object)")

Comment thread spec/index.bs Outdated
Comment thread spec/index.bs
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs
Comment thread spec/index.bs Outdated
Comment thread spec/index.bs Outdated

@kvark kvark left a comment

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.

Almost there, from my side :)

Comment thread spec/index.bs Outdated

1. Return a new error {{GPUBindGroupLayout}}.

1. Return a new {{GPUBindGroupLayout}} wrapping

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.

Ok, that makes sense.
Sounds like some clarification is needed in the spec itself. Maybe shorter, but just saying it's a "wrap" is not clear.

Comment thread spec/index.bs

@kvark kvark left a comment

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.

The last concern should be addressed after #724 lands

Comment thread spec/index.bs Outdated

1. Return a new error {{GPUBindGroupLayout}}.

1. Return a new {{GPUBindGroupLayout}} wrapping

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.

Is the plan to do it for all objects? +CC @kainino0x

Yes (see "define texture (internal object)", "define buffer (internal object)")

@Kangz

Kangz commented Apr 30, 2020

Copy link
Copy Markdown
Contributor Author

@JusSn PTAL!

@Kangz
Kangz force-pushed the getbindgrouplayout branch from 54f272c to aa7e653 Compare May 5, 2020 12:37
@Kangz

Kangz commented May 5, 2020

Copy link
Copy Markdown
Contributor Author

Squashed and rebase on top of @kvark's #724

Comment thread spec/index.bs
@kainino0x
kainino0x merged commit 3d78ea6 into gpuweb:master May 7, 2020
@Kangz
Kangz deleted the getbindgrouplayout branch May 7, 2020 17:04
JusSn pushed a commit to JusSn/gpuweb that referenced this pull request Jun 8, 2020
* Add GPUPipelineBase.getBindGroupLayout.

* Add an issue
JusSn pushed a commit to JusSn/gpuweb that referenced this pull request Jun 8, 2020
* Add GPUPipelineBase.getBindGroupLayout.

* Add an issue
ben-clayton pushed a commit to ben-clayton/gpuweb that referenced this pull request Sep 6, 2022
WGSL now uses entry point function parameters and return values for
entry point IO, instead of module-scope variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants