-
Notifications
You must be signed in to change notification settings - Fork 344
Add aspect back to GPUTextureCopyView #873
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
spec/index.bs
Outdated
| - If |format| is a depth-stencil format: | ||
| - |copiesWholeSubresources| must be true. | ||
| - |source| and |destination| must refer to the same set of aspects | ||
| (depth, stencil, or both depth and stencil). |
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.
On a related note, if we allow multi-aspect T2T copies then it makes about as much sense to allow multi-miplevel T2T copies, but honestly both are very unimportant. We could remove multi-aspect T2T copies.
|
Considering this to be soft-blocked on #652 (comment) because it's somewhat more difficult to discuss this without that resolved. |
|
TODO:
|
|
@austinEng can you help push this forward? It seems that the aspect member was required for B2T and T2B copies of depth-stencil no? |
austinEng
left a comment
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.
IIRC, in one of the meetings we already received feedback from @RafaelCintron that single-aspect copies from DS formats are tightly packed. Experimentally this is also true on Metal, but @litherum could you please check directly with the Metal team?
spec/index.bs
Outdated
| - If |textureCopyView|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}} | ||
| has both depth and stencil aspects, | ||
| |textureCopyView|.{{GPUTextureCopyView/aspect}} must be | ||
| {{GPUTextureAspect/"depth-only"}} or {{GPUTextureAspect/"stencil-only"}}. |
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.
"all" should be allowed here for the T2T case
We should only validate the if "depth-only" or "stencil-only" is specified, that the texture actually has a depth or stencil aspect, respectively.
Based on #997 we also need validation that the entire subresource is selected for depth or stencil textures (with OutputAttachment usage TBD..)
We should move the "depth-only" and "stencil-only" part to validation of T2B, B2T and WriteTexture. Probably "all" should be allowed on depth32float? So have some language that the GPUTextureCopyView.aspect "resolves to" a single aspect.
And put the "all" restriction for T2T copies. maybe saying that GPUTextureCopyView.aspect "resolves to" all the texture aspects
|
The documentation and conclusion about D3D12 is here: |
|
With #652 resolved I need to pick this back up again. |
Per discussions on gpuweb#652. It was removed in gpuweb#143.
- Cannot the depth aspect in copyBufferToTexture - Must copy all aspects in copyTextureToTexture - Must copy a single aspect in copies between buffers/textures - Must copy the whole subresource for any copy texture command if the format is a depth-stencil format or sample count > 1
10a919d to
56ccdc9
Compare
| - |source|.{{GPUBufferCopyView/buffer}}.{{GPUBuffer/[[usage]]}} contains | ||
| {{GPUBufferUsage/COPY_SRC}}. | ||
| - [$validating GPUTextureCopyView$](|destination|) returns `true`. | ||
| - [$validating GPUTextureCopyView$](|destination|, |copySize|) returns `true`. |
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.
Are these copySize additions from another cset?
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 could move this into a different PR. The existing validation only checked the whole-subresource-copied restriction for depth-stencil and multisampled textures on T2T copies, but in D3D12 the restriction is on T2T, T2B, and B2T.
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 multisampled this was because T2B and B2T can't do multisampled at all. But I think it's okay to be slightly redundant.
|
Resolution: Make sure we write down somewhere it doesn't work with copies to/from depth24plus or copies to depth32float. Otherwise should be accepted |
|
Is https://gpuweb.github.io/gpuweb/#depth-formats not sufficient to indicate what copies are valid? |
|
I think it is, I just didn't know offhand during the meeting whether we had that already. |
42d31bf to
1880d1f
Compare
kainino0x
left a comment
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.
LGTM
| - |source|.{{GPUBufferCopyView/buffer}}.{{GPUBuffer/[[usage]]}} contains | ||
| {{GPUBufferUsage/COPY_SRC}}. | ||
| - [$validating GPUTextureCopyView$](|destination|) returns `true`. | ||
| - [$validating GPUTextureCopyView$](|destination|, |copySize|) returns `true`. |
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 multisampled this was because T2B and B2T can't do multisampled at all. But I think it's okay to be slightly redundant.
| - If |source|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}} is a depth-stencil format: | ||
| - |source|.{{GPUTextureCopyView/aspect}} must refer to a single copyable aspect of | ||
| |source|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}}. | ||
| See [[#depth-formats|depth-formats]]. |
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.
As a followup, let's consider deduplicating this validation into a common place for B2T/T2B/writeTexture.
|
Merging with the agreement from the meeting |
…puweb#873) This also makes the texture1d size tests avoid depth-stencil formats because they are not valid for 1D textures. Also improves the coverage of mipLevelCount validation a bit.
Per discussions on #652. It was removed in #143.
Preview | Diff