@@ -3089,7 +3089,8 @@ to.
30893089 {{GPUTextureUsage/COPY_DST}},
30903090 {{GPUTextureUsage/TEXTURE_BINDING}},
30913091 {{GPUTextureUsage/STORAGE_BINDING}},
3092- {{GPUTextureUsage/RENDER_ATTACHMENT}}
3092+ {{GPUTextureUsage/RENDER_ATTACHMENT}},
3093+ {{GPUTextureUsage/TRANSIENT_ATTACHMENT}}
30933094
30943095 <!-- As needed, compute more allowed usages based on the features enabled on the device. -->
30953096</div>
@@ -4290,11 +4291,12 @@ enum GPUTextureDimension {
42904291typedef [EnforceRange] unsigned long GPUTextureUsageFlags;
42914292[Exposed=(Window, Worker), SecureContext]
42924293namespace GPUTextureUsage {
4293- const GPUFlagsConstant COPY_SRC = 0x01;
4294- const GPUFlagsConstant COPY_DST = 0x02;
4295- const GPUFlagsConstant TEXTURE_BINDING = 0x04;
4296- const GPUFlagsConstant STORAGE_BINDING = 0x08;
4297- const GPUFlagsConstant RENDER_ATTACHMENT = 0x10;
4294+ const GPUFlagsConstant COPY_SRC = 0x01;
4295+ const GPUFlagsConstant COPY_DST = 0x02;
4296+ const GPUFlagsConstant TEXTURE_BINDING = 0x04;
4297+ const GPUFlagsConstant STORAGE_BINDING = 0x08;
4298+ const GPUFlagsConstant RENDER_ATTACHMENT = 0x10;
4299+ const GPUFlagsConstant TRANSIENT_ATTACHMENT = 0x20;
42984300};
42994301</script>
43004302
@@ -4329,6 +4331,11 @@ The {{GPUTextureUsage}} flags determine how a {{GPUTexture}} may be used after i
43294331 The texture can be used as a color or depth/stencil attachment in a render pass.
43304332 (Example: as a {{GPURenderPassColorAttachment}}.{{GPURenderPassColorAttachment/view}} or
43314333 {{GPURenderPassDepthStencilAttachment}}.{{GPURenderPassDepthStencilAttachment/view}}.)
4334+
4335+ : <dfn>TRANSIENT_ATTACHMENT</dfn>
4336+ ::
4337+ The texture is intended to be temporary (a hint for optimization), as it is only used within
4338+ a render pass.
43324339</dl>
43334340
43344341<div algorithm data-timeline=const>
@@ -4485,6 +4492,8 @@ The {{GPUTextureUsage}} flags determine how a {{GPUTexture}} may be used after i
44854492 - If |descriptor|.{{GPUTextureDescriptor/usage}} includes the {{GPUTextureUsage/STORAGE_BINDING}} bit:
44864493 - |descriptor|.{{GPUTextureDescriptor/format}} must be listed in [[#plain-color-formats]] table
44874494 with {{GPUTextureUsage/STORAGE_BINDING}} capability for at least one access mode.
4495+ - If |descriptor|.{{GPUTextureDescriptor/usage}} includes the {{GPUTextureUsage/TRANSIENT_ATTACHMENT}} bit:
4496+ - |descriptor|.{{GPUTextureDescriptor/usage}} must be equal to {{GPUTextureUsage/TRANSIENT_ATTACHMENT}} | {{GPUTextureUsage/RENDER_ATTACHMENT}}.
44884497 - For each |viewFormat| in |descriptor|.{{GPUTextureDescriptor/viewFormats}},
44894498 |descriptor|.{{GPUTextureDescriptor/format}} and |viewFormat| must be
44904499 [=texture view format compatible=].
@@ -12036,6 +12045,9 @@ dictionary GPURenderPassColorAttachment {
1203612045
1203712046 1. |this|.{{GPURenderPassColorAttachment/depthSlice}} |must| not [=map/exist|be provided=].
1203812047
12048+ 1. If |renderViewDescriptor|.{{GPUTextureViewDescriptor/usage}} includes the {{GPUTextureUsage/TRANSIENT_ATTACHMENT}} bit:
12049+ 1. |this|.{{GPURenderPassColorAttachment/loadOp}} must be {{GPULoadOp/"clear"}}.
12050+ 1. |this|.{{GPURenderPassColorAttachment/storeOp}} must be {{GPUStoreOp/"discard"}}.
1203912051 1. If |this|.{{GPURenderPassColorAttachment/loadOp}} is {{GPULoadOp/"clear"}}:
1204012052 1. Converting the IDL value |this|.{{GPURenderPassColorAttachment/clearValue}}
1204112053 [$to a texel value of texture format$] |renderViewDescriptor|.{{GPUTextureViewDescriptor/format}}
@@ -12182,13 +12194,17 @@ dictionary GPURenderPassDepthStencilAttachment {
1218212194 - |this|.{{GPURenderPassDepthStencilAttachment/view}} must have a [=depth-or-stencil format=].
1218312195 - |this|.{{GPURenderPassDepthStencilAttachment/view}} must be a [$renderable texture view$].
1218412196 - Let |format| be |this|.{{GPURenderPassDepthStencilAttachment/view}}.{{GPUTextureView/[[descriptor]]}}.{{GPUTextureViewDescriptor/format}}.
12197+ - Let |usage| be |this|.{{GPURenderPassDepthStencilAttachment/view}}.{{GPUTextureView/[[descriptor]]}}.{{GPUTextureViewDescriptor/usage}}.
1218512198 - If |this|.{{GPURenderPassDepthStencilAttachment/depthLoadOp}} is {{GPULoadOp/"clear"}},
1218612199 |this|.{{GPURenderPassDepthStencilAttachment/depthClearValue}} must [=map/exist|be provided=] and must be between 0.0 and 1.0,
1218712200 inclusive.
1218812201 <!-- POSTV1(unrestricted-depth): unless unrestricted depth is enabled -->
1218912202 - If |format| has a depth aspect and |this|.{{GPURenderPassDepthStencilAttachment/depthReadOnly}} is `false`:
1219012203 - |this|.{{GPURenderPassDepthStencilAttachment/depthLoadOp}} must [=map/exist|be provided=].
1219112204 - |this|.{{GPURenderPassDepthStencilAttachment/depthStoreOp}} must [=map/exist|be provided=].
12205+ - If |usage| includes the {{GPUTextureUsage/TRANSIENT_ATTACHMENT}} bit:
12206+ - |this|.{{GPURenderPassDepthStencilAttachment/depthLoadOp}} must be {{GPULoadOp/"clear"}}.
12207+ - |this|.{{GPURenderPassDepthStencilAttachment/depthStoreOp}} must be {{GPUStoreOp/"discard"}}.
1219212208
1219312209 Otherwise:
1219412210
@@ -12197,6 +12213,9 @@ dictionary GPURenderPassDepthStencilAttachment {
1219712213 - If |format| has a stencil aspect and |this|.{{GPURenderPassDepthStencilAttachment/stencilReadOnly}} is `false`:
1219812214 - |this|.{{GPURenderPassDepthStencilAttachment/stencilLoadOp}} must [=map/exist|be provided=].
1219912215 - |this|.{{GPURenderPassDepthStencilAttachment/stencilStoreOp}} must [=map/exist|be provided=].
12216+ - If |usage| includes the {{GPUTextureUsage/TRANSIENT_ATTACHMENT}} bit:
12217+ - |this|.{{GPURenderPassDepthStencilAttachment/stencilStoreOp}} must be {{GPULoadOp/"clear"}}.
12218+ - |this|.{{GPURenderPassDepthStencilAttachment/stencilStoreOp}} must be {{GPUStoreOp/"discard"}}.
1220012219
1220112220 Otherwise:
1220212221