summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/rendering/depth_clip_clamp.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/rendering/depth_clip_clamp.spec.ts')
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/rendering/depth_clip_clamp.spec.ts20
1 files changed, 14 insertions, 6 deletions
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/rendering/depth_clip_clamp.spec.ts b/dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/rendering/depth_clip_clamp.spec.ts
index 65e2e8af1f..1d3b6d8b7a 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/rendering/depth_clip_clamp.spec.ts
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/rendering/depth_clip_clamp.spec.ts
@@ -4,6 +4,7 @@ depth ranges as well.
`;
import { makeTestGroup } from '../../../../common/framework/test_group.js';
+import { assert } from '../../../../common/util/util.js';
import { kDepthStencilFormats, kTextureFormatInfo } from '../../../format_info.js';
import { GPUTest } from '../../../gpu_test.js';
import {
@@ -52,6 +53,7 @@ have unexpected values then get drawn to the color buffer, which is later checke
.fn(async t => {
const { format, unclippedDepth, writeDepth, multisampled } = t.params;
const info = kTextureFormatInfo[format];
+ assert(!!info.depth);
/** Number of depth values to test for both vertex output and frag_depth output. */
const kNumDepthValues = 8;
@@ -222,16 +224,16 @@ have unexpected values then get drawn to the color buffer, which is later checke
: undefined;
const dsActual =
- !multisampled && info.bytesPerBlock
+ !multisampled && info.depth.bytes
? t.device.createBuffer({
- size: kNumTestPoints * info.bytesPerBlock,
+ size: kNumTestPoints * info.depth.bytes,
usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ,
})
: undefined;
const dsExpected =
- !multisampled && info.bytesPerBlock
+ !multisampled && info.depth.bytes
? t.device.createBuffer({
- size: kNumTestPoints * info.bytesPerBlock,
+ size: kNumTestPoints * info.depth.bytes,
usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ,
})
: undefined;
@@ -270,7 +272,9 @@ have unexpected values then get drawn to the color buffer, which is later checke
pass.end();
}
if (dsActual) {
- enc.copyTextureToBuffer({ texture: dsTexture }, { buffer: dsActual }, [kNumTestPoints]);
+ enc.copyTextureToBuffer({ texture: dsTexture, aspect: 'depth-only' }, { buffer: dsActual }, [
+ kNumTestPoints,
+ ]);
}
{
const clearValue = [0, 0, 0, 0]; // Will see this color if the check passed.
@@ -302,7 +306,11 @@ have unexpected values then get drawn to the color buffer, which is later checke
}
enc.copyTextureToBuffer({ texture: checkTexture }, { buffer: checkBuffer }, [kNumTestPoints]);
if (dsExpected) {
- enc.copyTextureToBuffer({ texture: dsTexture }, { buffer: dsExpected }, [kNumTestPoints]);
+ enc.copyTextureToBuffer(
+ { texture: dsTexture, aspect: 'depth-only' },
+ { buffer: dsExpected },
+ [kNumTestPoints]
+ );
}
t.device.queue.submit([enc.finish()]);