Skip to content

Commit f5d8a0a

Browse files
Additional validation of texture copies (#7935)
* Additional validation of texture copies * Copies must not overlap. * Copies of multisampled or depth/stencil formats must span the entire texture. * Move no-op for zero-size copies after parameter validation. Closes #2951 Fixes #7844 * Fix issue with combined depth+stencil copy on dx12 * PR feedback
1 parent 601c423 commit f5d8a0a

File tree

4 files changed

+231
-124
lines changed

4 files changed

+231
-124
lines changed

cts_runner/test.lst

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,7 @@ webgpu:api,validation,encoding,beginRenderPass:*
1010
webgpu:api,validation,encoding,cmds,clearBuffer:*
1111
webgpu:api,validation,encoding,cmds,compute_pass:set_pipeline:*
1212
webgpu:api,validation,encoding,cmds,compute_pass:dispatch_sizes:*
13-
webgpu:api,validation,encoding,cmds,copyTextureToTexture:copy_with_invalid_or_destroyed_texture:*
14-
webgpu:api,validation,encoding,cmds,copyTextureToTexture:texture,device_mismatch:*
15-
webgpu:api,validation,encoding,cmds,copyTextureToTexture:mipmap_level:*
16-
webgpu:api,validation,encoding,cmds,copyTextureToTexture:texture_usage:*
17-
webgpu:api,validation,encoding,cmds,copyTextureToTexture:sample_count:*
18-
//FAIL: webgpu:api,validation,encoding,cmds,copyTextureToTexture:multisampled_copy_restrictions:*
19-
// texture_format_compatibility fails on Windows and Mac in CI.
20-
// It passes locally on Mac. It is also a relatively long test.
21-
//FAIL: webgpu:api,validation,encoding,cmds,copyTextureToTexture:texture_format_compatibility:*
22-
//FAIL: webgpu:api,validation,encoding,cmds,copyTextureToTexture:depth_stencil_copy_restrictions:*
23-
//FAIL: webgpu:api,validation,encoding,cmds,copyTextureToTexture:copy_ranges:*
24-
//FAIL: webgpu:api,validation,encoding,cmds,copyTextureToTexture:copy_within_same_texture:*
25-
//FAIL: webgpu:api,validation,encoding,cmds,copyTextureToTexture:copy_aspects:*
26-
// Fails on Windows, https://github.com/gfx-rs/wgpu/issues/7844.
27-
//FAIL: webgpu:api,validation,encoding,cmds,copyTextureToTexture:copy_ranges_with_compressed_texture_formats:*
13+
webgpu:api,validation,encoding,cmds,copyTextureToTexture:*
2814
webgpu:api,validation,encoding,cmds,index_access:*
2915
//FAIL: webgpu:api,validation,encoding,cmds,render,draw:*
3016
webgpu:api,validation,encoding,cmds,render,draw:index_buffer_OOB:*

wgpu-core/src/command/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ impl CommandEncoderStatus {
289289
// Since we do not track the state of an invalid encoder, it is not
290290
// necessary to unlock an encoder that has been invalidated.
291291
fn invalidate<E: Clone + Into<CommandEncoderError>>(&mut self, err: E) -> E {
292-
*self = Self::Error(err.clone().into());
292+
let enc_err = err.clone().into();
293+
api_log!("Invalidating command encoder: {enc_err:?}");
294+
*self = Self::Error(enc_err);
293295
err
294296
}
295297
}

0 commit comments

Comments
 (0)