-
Notifications
You must be signed in to change notification settings - Fork 345
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
Changes from all commits
fb3de3f
56ccdc9
1880d1f
2b25ea2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4456,6 +4456,7 @@ dictionary GPUTextureCopyView { | |
| required GPUTexture texture; | ||
| GPUIntegerCoordinate mipLevel = 0; | ||
| GPUOrigin3D origin = {}; | ||
| GPUTextureAspect aspect = "all"; | ||
kainino0x marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
| </script> | ||
|
|
||
|
|
@@ -4469,6 +4470,7 @@ offset {{GPUOrigin3D}} in texels, used when copying data from or to a {{GPUTextu | |
|
|
||
| **Arguments:** | ||
| - {{GPUTextureCopyView}} |textureCopyView| | ||
| - {{GPUExtent3D}} |copySize| | ||
|
|
||
| **Returns:** {{boolean}} | ||
|
|
||
|
|
@@ -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> | ||
|
|
||
|
|
@@ -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`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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]]}}. | ||
austinEng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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]]}}. | ||
|
|
@@ -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]]. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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}}. | ||
|
|
@@ -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 | ||
|
|
@@ -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()}}, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.