Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guarantee that OOB writes to storage textures will be ignored #4194

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

teoxoy
Copy link
Member

@teoxoy teoxoy commented Jun 23, 2023

@teoxoy teoxoy closed this Jun 23, 2023
@teoxoy teoxoy deleted the patch-1 branch June 23, 2023 13:23
@teoxoy teoxoy restored the patch-1 branch June 23, 2023 13:25
@teoxoy teoxoy reopened this Jun 23, 2023
@alan-baker
Copy link
Contributor

We shipped the clamping behaviour on backends that need clamping. So we can't strengthen the spec in this way.

@teoxoy
Copy link
Member Author

teoxoy commented Jun 27, 2023

I see that tint is indeed clamping. But as far as I found that shouldn't be necessary.

Would this have to land in a v2 of the WGSL spec instead?

@jimblandy
Copy link
Contributor

jimblandy commented Jun 27, 2023

on backends that need clamping

@alan-baker Which backends need clamping? Teo is saying that none exist; if that's not the case, then that changes everything.

@alan-baker
Copy link
Contributor

I thought remembered reading it UB on one platform, but I can't find that text anywhere. When I look through the various specs it does seem to that writes are discarded.

@jimblandy
Copy link
Contributor

@alan-baker So, did Dawn actually ship clamping OOB texture writes on any backends, then?

@ben-clayton
Copy link
Collaborator

@alan-baker So, did Dawn actually ship clamping OOB texture writes on any backends, then?

Yes. We shipped M113 with clamping on all backends. Texture write clamping was recently disabled for D3D.

Based on #3893 (comment), perhaps we can do the same for other backends. We do have a GLSL backend - I haven't done my homework to determine whether OOB writes there are also automatically discarded.

@teoxoy
Copy link
Member Author

teoxoy commented Jun 29, 2023

The OpenGL 4.2+ and OpenGL ES 3.1+ specs say "Invalid image stores will have no effect.".

@kainino0x kainino0x added the wgsl WebGPU Shading Language Issues label May 21, 2024
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.

None yet

6 participants