这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@kainino0x
Copy link
Contributor

@kainino0x kainino0x commented Jun 20, 2020

Per discussions on #652. It was removed in #143.


Preview | Diff

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).
Copy link
Contributor Author

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.

@kainino0x
Copy link
Contributor Author

Considering this to be soft-blocked on #652 (comment) because it's somewhat more difficult to discuss this without that resolved.

@kvark kvark changed the base branch from master to main June 23, 2020 13:13
@kainino0x
Copy link
Contributor Author

TODO:

  • Disallow T2T copies with aspects selected
  • Figure out if copies to/from stencil aspect of DS format in D3D12 is tightly packed (@RafaelCintron @damyanp)
  • Figure out if copies to/from stencil aspect of DS format in Metal is tightly packed (@litherum)

@kainino0x kainino0x self-assigned this Jul 17, 2020
@kainino0x kainino0x marked this pull request as draft July 17, 2020 18:29
@Kangz
Copy link
Contributor

Kangz commented Aug 14, 2020

@austinEng can you help push this forward? It seems that the aspect member was required for B2T and T2B copies of depth-stencil no?

Copy link
Contributor

@austinEng austinEng left a 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"}}.
Copy link
Contributor

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

@kainino0x
Copy link
Contributor Author

The documentation and conclusion about D3D12 is here:
#652 (comment)
That issue is now assigned to Dean/Myles to figure out the answer on Metal

@kainino0x
Copy link
Contributor Author

With #652 resolved I need to pick this back up again.

kainino0x and others added 2 commits October 21, 2020 12:48
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
@kainino0x kainino0x force-pushed the texturecopyview-aspect branch from 10a919d to 56ccdc9 Compare October 21, 2020 17:56
@kainino0x kainino0x marked this pull request as ready for review October 21, 2020 20:40
- |source|.{{GPUBufferCopyView/buffer}}.{{GPUBuffer/[[usage]]}} contains
{{GPUBufferUsage/COPY_SRC}}.
- [$validating GPUTextureCopyView$](|destination|) returns `true`.
- [$validating GPUTextureCopyView$](|destination|, |copySize|) returns `true`.
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@kainino0x
Copy link
Contributor Author

Resolution: Make sure we write down somewhere it doesn't work with copies to/from depth24plus or copies to depth32float. Otherwise should be accepted

@kvark
Copy link
Contributor

kvark commented Oct 21, 2020

Is https://gpuweb.github.io/gpuweb/#depth-formats not sufficient to indicate what copies are valid?

@kainino0x
Copy link
Contributor Author

I think it is, I just didn't know offhand during the meeting whether we had that already.

@austinEng austinEng force-pushed the texturecopyview-aspect branch from 42d31bf to 1880d1f Compare October 22, 2020 21:05
Copy link
Contributor Author

@kainino0x kainino0x left a 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`.
Copy link
Contributor Author

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]].
Copy link
Contributor Author

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.

@kainino0x
Copy link
Contributor Author

Merging with the agreement from the meeting

@kainino0x kainino0x merged commit e3dde36 into gpuweb:main Oct 29, 2020
@kainino0x kainino0x deleted the texturecopyview-aspect branch October 29, 2020 19:13
@kainino0x kainino0x assigned austinEng and unassigned kainino0x Oct 29, 2020
ben-clayton pushed a commit to ben-clayton/gpuweb that referenced this pull request Sep 6, 2022
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants