-
Notifications
You must be signed in to change notification settings - Fork 335
Add the mip level and array layer consensus proposals. #4365
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
Conversation
Previews, as seen when this build job started (0c0b2cc): |
proposals/compatibility-mode.md
Outdated
|
||
**Justification**: OpenGL ES does not support texture views, but one mip level subset may be specified per texture using `glTexParameter*()` via the `GL_TEXTURE_BASE_LEVEL` and `GL_TEXTURE_MAX_LEVEL` parameters. | ||
|
||
### 6. Array texture views used in draw calls must consist of the entire array. That is, `baseArrayLayer` must be zero, and `arrayLayerCount` must be equal to the size of the texture array. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We could say "in bind groups" since that could be validated at bind-group creation. The paragraph below would need an update too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For mip levels it's actually at draw time since you might have different sub level ranges in different bind groups.
Should we validate both that at createBindGroup that there is not more than 1 sub level range or or should we skip that since at draw time we need to validate there is only 1 sub level range across all bind groups?
For layers sub ranges it would be at createBindGroup time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct that for mip levels it would be at draw time, but here the comment was just for array layers. I agree that mip levels should just be validated at draw time. (with optimization possible in browsers to validate at createBindGroup if they find that this is helping perf)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I also modified the paragraph below to address storage textures: "Only views of the entire array are supported for sampling or storage bindings." LMK if that's incorrect.
00af3a2
to
6f05a8c
Compare
proposals/compatibility-mode.md
Outdated
|
||
### 5. Views of the same texture used in a single draw may not differ in mip levels. | ||
|
||
A draw call may not bind two views of the same texture differing in `baseMipLevel` or `mipLevelCount`. Only a single mip level range range per texture is supported. This is enforced via validation at encode time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How specific should we get in the proposal vs the actual spec?
This is valid
setBindGroup(0, subView1);
setBindGroup(1, subView2); // incompatible with subView1
draw() // pipeline that only uses subView1 (via group(0))
both setBindGroup
and draw
are "encoding". Not sure if that's being too nit-picky but the final spec will need to make that clear that it's only validated on draw and only cares about bindgroups actually used. (or even if it cares about all of them it still has to at draw cmd encoding, not setBindGroup cmd encoding)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should try to be fairly precise in proposals, so that translation to spec text doesn't require roundtrips to the group ideally. +1 that this should be checked on draw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I've changed it to "draw time". Now maybe I'm being overly picky, but to me draw time is when the draw command is executed, not when it is encoded. OTOH, no validation occurs on execution, so perhaps it's ok in this case. Futher wordsmithing welcome.)
|
||
### 6. Array texture views used in bind groups must consist of the entire array. That is, `baseArrayLayer` must be zero, and `arrayLayerCount` must be equal to the size of the texture array. | ||
|
||
A bind group may not reference a subset of array layers. Only views of the entire array are supported for sampling or storage bindings. This is enforced via validation at bind group creation time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this will come up or needs to be mentioned. I think it might have been brought up before. This is enforced at bind group creation and not create view time because it's still valid to make a sub range of 1 layer use as a render attachment
The issue of validating out "2d" of more than 1 layer is not mentioned in this proposal. It seems like it came up in the meeting. In other words,
Should fail with a validation error I think similarly
should fail with a validation error. This would already fail at view creation time but seems like it should fail here because GL can't create a 2 layer cube map which is what's being asking for here |
These are good points. We discussed the first one in the meeting, but not the cube map one. I think they probably belong under the first restriction ("Texture view dimension may be specified") rather than in the arrayLayers restriction. I'll add it to my backlog of PRs. |
Add sections to the compatbility-mode proposal to reflect the consensus on mip level and array layer constraints: one mip level per texture, and no array layer subsetting.