Skip to content

Conversation

@alan-baker
Copy link
Contributor

Fixes #1567, #1471, #1457, #1139

  • No recursion
  • No calling entry points
  • fragment shader must return position
  • aliasing restrictions
  • pointer restrictions

The allowance handle pointer parameters is somewhat debatable, but I've included it since we don't have a clear alternative at the moment.

Fixes gpuweb#1567, gpuweb#1471, gpuweb#1457, gpuweb#1139

* No recursion
* No calling entry points
* fragment shader must return position
* aliasing restrictions
* pointer restrictions
@alan-baker alan-baker added the wgsl WebGPU Shading Language Issues label Apr 26, 2021
@alan-baker alan-baker requested review from dneto0, kvark and litherum April 26, 2021 19:00
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

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

Copy link
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Looks great.

I've got two nits.

* clarify possible return types to disallow handles
* clarify aliasing
@kdashg
Copy link
Contributor

kdashg commented Apr 27, 2021

WGSL meeting minutes 2021-04-27
  • AB: The contentious part is whether you can pass a handle by pointer. I left that in. Otherwise, the restrictions reflect basic SPIR-V.
  • MM: At office hours, discussed that maybe if we allow texture pointers, it might break some of the analysis we want to do
  • DN: For texture filtering? (yes) How does that leak into WGSL?
  • MM: If possible to pass by ref, at the point that you compile, the pipeline layout tells you the inner type of the texture and whether it’s sampleable. If textures are named specifically, we can do this validation.
  • DM: Yes we need to know what textures are used by which samplers
  • MM: Can we add more types for this?
  • DM: We had that proposal earlier, and we didn’t want that at that time
  • DN: What’s proposal for passing tex/samplers to functions?
  • MM: By pointer would be great. If we want to keep the analysis, I think we wouldn’t be able to do this, rather you’d have to name it. I wish we could fix this. Statically determining tex/sampler at compiler time is valuable.
  • KN: I thought it wasn’t just analysis, but also some hardware needs to be able to determine this.
  • JG: Well, spirv isn’t really that flexible. Can determine static-use
  • KN: Could do e.g. unrolling to figure these out
  • MM: Let’s see if we can figure this out offline
  • DN: Can we land this without the contested bits?

Copy link
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@dneto0 dneto0 merged commit 73966b5 into gpuweb:main May 6, 2021
@alan-baker alan-baker deleted the function-restrictions branch August 20, 2021 14:14
ben-clayton pushed a commit to ben-clayton/gpuweb that referenced this pull request Sep 6, 2022
…ar_value (gpuweb#1674)

This PR updates render_pass_descriptor:depth_stencil_attachment_depth_clear_value
to check if out of range of depthClearValue is only invalid when depthLoadOp is
`clear'. If depthLoadOp is not `clear`, depthClearValue should be valid even
though the value is out of range.

Issue: gpuweb#1618
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wgsl WebGPU Shading Language Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require that vertex shaders return a position?

6 participants