Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Kangz
Copy link
Contributor

@Kangz Kangz commented Jan 15, 2020

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 kvark, kainino0x and JusSn January 15, 2020 15:04
Copy link
Contributor

@kainino0x kainino0x left a comment

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

@Kangz Kangz force-pushed the getbindgrouplayout branch from aee44b1 to e96bd3e Compare April 21, 2020 13:59
@Kangz
Copy link
Contributor Author

Kangz commented Apr 21, 2020

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

Copy link
Contributor

@kvark kvark left a comment

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.

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
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
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!

spec/index.bs Outdated

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

1. Return a new {{GPUBindGroupLayout}} wrapping
Copy link
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
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
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
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
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
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)")

Copy link
Contributor

@kvark kvark left a comment

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 :)

spec/index.bs Outdated

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

1. Return a new {{GPUBindGroupLayout}} wrapping
Copy link
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
Contributor

@kvark kvark left a comment

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

spec/index.bs Outdated

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

1. Return a new {{GPUBindGroupLayout}} wrapping
Copy link
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
Copy link
Contributor Author

Kangz commented Apr 30, 2020

@JusSn PTAL!

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

Kangz commented May 5, 2020

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

@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