Skip to content

Allow arrays with pipeline-overridable element count, as store type for workgroup variable#2347

Merged
dneto0 merged 1 commit intogpuweb:mainfrom
dneto0:issue-2024-pipeline-sized-wg-array
Dec 8, 2021
Merged

Allow arrays with pipeline-overridable element count, as store type for workgroup variable#2347
dneto0 merged 1 commit intogpuweb:mainfrom
dneto0:issue-2024-pipeline-sized-wg-array

Conversation

@dneto0
Copy link
Contributor

@dneto0 dneto0 commented Nov 25, 2021

Builds on #2104 because that defines the useful concept of
"fixed-footprint" type.

* Refines "fixed-footprint" to add subcategory of "creation-fixed footprint",
  to mean a plain type whose memory footprint is fixed at shader
  creation time. The "fixed-footprint" remains defined as a plain type
  whose memory footprint is fixed by the pipline-creation time.

* Allow element count on a fixed-size array to be an overridable
  module-scope constant.
  * Later I expect we'll have a proper category and name for pipeline-constexpr
    and we can patch this up at that time.

* Previously "fixed-size array" meant element count was a
  shader-creatio-time constant. Now it allows pipeline-creation
  constant, so revisit all uses of "fixed-size array" and further
  qualify with "with creation-fixed footprint" in the intended places:

  In particular:
   - array element must be fixed-footprint.
   - structure member that is fixed-size array must be fixed-footprint

* Note and provide examples that the store type for a workgroup variable
   may have an element count that is pipeline-overridable.
   It has fixed footprint but not necessarily creation-time fixed footprint.

* Editorially emphasize that type constructors only create constructible
  types.

Fixes: #2024

@dneto0 dneto0 added wgsl WebGPU Shading Language Issues wgsl resolved Resolved - waiting for a change to the WGSL specification labels Nov 25, 2021
@dneto0 dneto0 added this to the V1.0 milestone Nov 25, 2021
@dneto0 dneto0 marked this pull request as draft November 25, 2021 22:38
@dneto0
Copy link
Contributor Author

dneto0 commented Nov 25, 2021

Keeping this as draft until #2104 lands.

@github-actions
Copy link
Contributor

Previews, as seen when this build job started (da23ff1):
WebGPU | IDL
WGSL
Explainer

@kvark
Copy link
Contributor

kvark commented Nov 25, 2021

last commit LGTM

@dneto0 dneto0 force-pushed the issue-2024-pipeline-sized-wg-array branch from da23ff1 to 7494bf6 Compare December 2, 2021 22:59
@dneto0
Copy link
Contributor Author

dneto0 commented Dec 2, 2021

Rebased, and:

  • updated rule about when two array types are the same
  • updated rule about zero-initialization of workgroup variable (because the new kind of arrays are not constructible, and hence don't have zero values)

@dneto0 dneto0 marked this pull request as ready for review December 2, 2021 23:02
@dneto0 dneto0 requested review from alan-baker and litherum December 7, 2021 15:30
@kdashg
Copy link
Contributor

kdashg commented Dec 8, 2021

WGSL meeting minutes 2021-12-07

…or workgroup variable

* Refines "fixed-footprint" to add subcategory of "creation-fixed footprint",
  to mean a plain type whose memory footprint is fixed at shader
  creation time. The "fixed-footprint" remains defined as a plain type
  whose memory footprint is fixed by the pipline-creation time.

* Allow element count on a fixed-size array to be an overridable
  module-scope constant.
  * Later I expect we'll have a proper category and name for pipeline-constexpr
    and we can patch this up at that time.

* Refine the rules about when two array types are the same.

* Refine the rule about initial value of a workgroup variable.

* Previously "fixed-size array" meant element count was a
  shader-creatio-time constant. Now it allows pipeline-creation
  constant, so revisit all uses of "fixed-size array" and further
  qualify with "with creation-fixed footprint" in the intended places:

  In particular:
   - array element must be fixed-footprint.
   - structure member that is fixed-size array must be fixed-footprint

* Note and provide examples that the store type for a workgroup variable
   may have an element count that is pipeline-overridable.
   It has fixed footprint but not necessarily creation-time fixed footprint.

* Editorially emphasize that type constructors only create constructible
  types.

Fixes: gpuweb#2024
@dneto0 dneto0 force-pushed the issue-2024-pipeline-sized-wg-array branch from 7494bf6 to 29b52d1 Compare December 8, 2021 21:11
@dneto0
Copy link
Contributor Author

dneto0 commented Dec 8, 2021

Rebased, and resolved a trivial conflict.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2021

Previews, as seen when this build job started (29b52d1):
WebGPU | IDL
WGSL
Explainer

@dneto0 dneto0 merged commit 0f57f3e into gpuweb:main Dec 8, 2021
github-actions bot added a commit that referenced this pull request Dec 8, 2021
…or workgroup variable (#2347)

SHA: 0f57f3e
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Dec 8, 2021
…or workgroup variable (#2347)

SHA: 0f57f3e
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit that referenced this pull request Dec 8, 2021
…or workgroup variable (#2347)

SHA: 0f57f3e
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wgsl resolved Resolved - waiting for a change to the WGSL specification wgsl WebGPU Shading Language Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamically sized threadgroup memory

3 participants