这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4456,6 +4456,7 @@ dictionary GPUTextureCopyView {
required GPUTexture texture;
GPUIntegerCoordinate mipLevel = 0;
GPUOrigin3D origin = {};
GPUTextureAspect aspect = "all";
};
</script>

Expand All @@ -4469,6 +4470,7 @@ offset {{GPUOrigin3D}} in texels, used when copying data from or to a {{GPUTextu

**Arguments:**
- {{GPUTextureCopyView}} |textureCopyView|
- {{GPUExtent3D}} |copySize|

**Returns:** {{boolean}}

Expand All @@ -4482,6 +4484,10 @@ offset {{GPUOrigin3D}} in texels, used when copying data from or to a {{GPUTextu
|textureCopyView|.{{GPUTextureCopyView/texture}}.
- |textureCopyView|.{{GPUTextureCopyView/origin}}.[=Origin3D/x=] must be a multiple of |blockWidth|.
- |textureCopyView|.{{GPUTextureCopyView/origin}}.[=Origin3D/y=] must be a multiple of |blockHeight|.
- The [=textureCopyView subresource size=] of |textureCopyView| is equal to |copySize| if either of
the following conditions is true:
- |textureCopyView|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}} is a depth-stencil format.
- |textureCopyView|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[sampleCount]]}} is greater than 1.

</div>

Expand Down Expand Up @@ -4695,10 +4701,14 @@ Issue: convert "Valid Texture Copy Range" into an algorithm with parameters, sim
- [$validating GPUBufferCopyView$](|source|) returns `true`.
- |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.

- |destination|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[textureUsage]]}} contains
{{GPUTextureUsage/COPY_DST}}.
- |destination|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[sampleCount]]}} is 1.
- If |destination|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}} is a depth-stencil format:
- |destination|.{{GPUTextureCopyView/aspect}} must refer to a single copyable aspect of
|destination|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}}.
See [[#depth-formats|depth-formats]].
- [=Valid Texture Copy Range=] applies to |destination| and |copySize|.
- |source|.{{GPUTextureDataLayout/offset}} is a multiple of the [=texel block size=]
of |destination|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}}.
Expand Down Expand Up @@ -4729,10 +4739,14 @@ Issue: convert "Valid Texture Copy Range" into an algorithm with parameters, sim
If any of the following conditions are unsatisfied, generate a validation error and stop.
<div class=validusage>
- |this|.{{GPUCommandEncoder/[[state]]}} is {{encoder state/open}}.
- [$validating GPUTextureCopyView$](|source|) returns `true`.
- [$validating GPUTextureCopyView$](|source|, |copySize|) returns `true`.
- |source|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[textureUsage]]}} contains
{{GPUTextureUsage/COPY_SRC}}.
- |source|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[sampleCount]]}} is 1.
- 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.

- [$validating GPUBufferCopyView$](|destination|) returns `true`.
- |destination|.{{GPUBufferCopyView/buffer}}.{{GPUBuffer/[[usage]]}} contains
{{GPUBufferUsage/COPY_DST}}.
Expand Down Expand Up @@ -4764,27 +4778,23 @@ Issue: convert "Valid Texture Copy Range" into an algorithm with parameters, sim

**Returns:** {{undefined}}

1. Let |copy of the whole subresource| be the command |this|.{{GPUCommandEncoder/copyTextureToTexture()}}
whose parameters |source|, |destination| and |copySize| meet the following conditions:
- The [=textureCopyView subresource size=] of |source| is equal to |copySize|.
- The [=textureCopyView subresource size=] of |destination| is equal to |copySize|.
1. If any of the following conditions are unsatisfied, generate a validation error and stop.
<div class=validusage>
- |this|.{{GPUCommandEncoder/[[state]]}} is {{encoder state/open}}.
- [$validating GPUTextureCopyView$](|source|) returns `true`.
- [$validating GPUTextureCopyView$](|source|, |copySize|) returns `true`.
- |source|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[textureUsage]]}} contains
{{GPUTextureUsage/COPY_SRC}}.
- [$validating GPUTextureCopyView$](|destination|) returns `true`.
- [$validating GPUTextureCopyView$](|destination|, |copySize|) returns `true`.
- |destination|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[textureUsage]]}} contains
{{GPUTextureUsage/COPY_DST}}.
- |source|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[sampleCount]]}} is equal to |destination|.
{{GPUTextureCopyView/texture}}.{{GPUTexture/[[sampleCount]]}}.
- If |source|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[sampleCount]]}} is greater than 1:
- The copy with |source|, |destination| and |copySize| is a |copy of the whole subresource|.
- |source|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}} is equal to |destination|.
{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}}.
- If |source|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}} is a depth-stencil format:
- The copy with |source|, |destination| and |copySize| is a |copy of the whole subresource|.
- |source|.{{GPUTextureCopyView/aspect}} and |destination|.{{GPUTextureCopyView/aspect}}
must both refer to all aspects of |source|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}}
and |destination|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}}, respectively.
- [=Valid Texture Copy Range=] applies to |source| and |copySize|.
- [=Valid Texture Copy Range=] applies to |destination| and |copySize|.
- The [$set of subresources for texture copy$](|source|, |copySize|) and
Expand Down Expand Up @@ -6459,12 +6469,15 @@ GPUQueue includes GPUObjectBase;
1. If any of the following conditions are unsatisfied,
generate a validation error and stop.
<div class=validusage>
- [$validating GPUTextureCopyView$](|destination|) returns `true`.
- [$validating GPUTextureCopyView$](|destination|, |size|) returns `true`.
- |destination|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[textureUsage]]}}
includes {{GPUTextureUsage/COPY_DST}}.
- |destination|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[sampleCount]]}} is 1.
- [=Valid Texture Copy Range=](|destination|, |size|)
is satisfied.
- |destination|.{{GPUTextureCopyView/aspect}} refers to a single copyable aspect
of |destination|.{{GPUTextureCopyView/texture}}.{{GPUTexture/[[format]]}}.
See [[#depth-formats|depth-formats]].

Note: unlike
{{GPUCommandEncoder}}.{{GPUCommandEncoder/copyBufferToTexture()}},
Expand Down