From 54e741adbddaa587e777bb8bca1fad1e8dba6ef1 Mon Sep 17 00:00:00 2001 From: Andy Leiserson Date: Fri, 29 May 2026 11:06:32 -0700 Subject: [PATCH] refactor(test): Rename `zero_init_texture_after_discard` -> `zero_init` --- tests/tests/wgpu-gpu/main.rs | 4 ++-- ...ro_init_texture_after_discard.rs => zero_init.rs} | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) rename tests/tests/wgpu-gpu/{zero_init_texture_after_discard.rs => zero_init.rs} (97%) diff --git a/tests/tests/wgpu-gpu/main.rs b/tests/tests/wgpu-gpu/main.rs index e8b52f585..8383e1d8a 100644 --- a/tests/tests/wgpu-gpu/main.rs +++ b/tests/tests/wgpu-gpu/main.rs @@ -81,7 +81,7 @@ mod vertex_formats; mod vertex_indices; mod vertex_state; mod write_texture; -mod zero_init_texture_after_discard; +mod zero_init; fn all_tests() -> Vec { let mut tests = Vec::new(); @@ -163,7 +163,7 @@ fn all_tests() -> Vec { vertex_indices::all_tests(&mut tests); vertex_state::all_tests(&mut tests); write_texture::all_tests(&mut tests); - zero_init_texture_after_discard::all_tests(&mut tests); + zero_init::all_tests(&mut tests); naga_capabilities::all_tests(&mut tests); tests diff --git a/tests/tests/wgpu-gpu/zero_init_texture_after_discard.rs b/tests/tests/wgpu-gpu/zero_init.rs similarity index 97% rename from tests/tests/wgpu-gpu/zero_init_texture_after_discard.rs rename to tests/tests/wgpu-gpu/zero_init.rs index 8bb9305ac..79078d500 100644 --- a/tests/tests/wgpu-gpu/zero_init_texture_after_discard.rs +++ b/tests/tests/wgpu-gpu/zero_init.rs @@ -19,7 +19,7 @@ static DISCARDING_COLOR_TARGET_RESETS_TEXTURE_INIT_STATE_CHECK_VISIBLE_ON_COPY_A GpuTestConfiguration = GpuTestConfiguration::new() .parameters(TestParameters::default().expect_fail(FailureCase::webgl2())) .run_async(|mut ctx| async move { - let mut case = TestCase::new(&mut ctx, TextureFormat::Rgba8UnormSrgb); + let mut case = DiscardTestCase::new(&mut ctx, TextureFormat::Rgba8UnormSrgb); case.create_command_encoder(); case.discard(); case.submit_command_encoder(); @@ -36,7 +36,7 @@ static DISCARDING_COLOR_TARGET_RESETS_TEXTURE_INIT_STATE_CHECK_VISIBLE_ON_COPY_I GpuTestConfiguration = GpuTestConfiguration::new() .parameters(TestParameters::default().expect_fail(FailureCase::webgl2())) .run_async(|mut ctx| async move { - let mut case = TestCase::new(&mut ctx, TextureFormat::Rgba8UnormSrgb); + let mut case = DiscardTestCase::new(&mut ctx, TextureFormat::Rgba8UnormSrgb); case.create_command_encoder(); case.discard(); case.copy_texture_to_buffer(); @@ -63,7 +63,7 @@ static DISCARDING_DEPTH_TARGET_RESETS_TEXTURE_INIT_STATE_CHECK_VISIBLE_ON_COPY_I TextureFormat::Depth24PlusStencil8, TextureFormat::Depth32Float, ] { - let mut case = TestCase::new(&mut ctx, format); + let mut case = DiscardTestCase::new(&mut ctx, format); case.create_command_encoder(); case.discard(); case.copy_texture_to_buffer(); @@ -92,7 +92,7 @@ static DISCARDING_EITHER_DEPTH_OR_STENCIL_ASPECT_TEST: GpuTestConfiguration = TextureFormat::Depth24PlusStencil8, TextureFormat::Depth32Float, ] { - let mut case = TestCase::new(&mut ctx, format); + let mut case = DiscardTestCase::new(&mut ctx, format); case.create_command_encoder(); case.discard_depth(); case.submit_command_encoder(); @@ -109,7 +109,7 @@ static DISCARDING_EITHER_DEPTH_OR_STENCIL_ASPECT_TEST: GpuTestConfiguration = } }); -struct TestCase<'ctx> { +struct DiscardTestCase<'ctx> { ctx: &'ctx mut TestingContext, format: TextureFormat, texture: Texture, @@ -117,7 +117,7 @@ struct TestCase<'ctx> { encoder: Option, } -impl<'ctx> TestCase<'ctx> { +impl<'ctx> DiscardTestCase<'ctx> { pub fn new(ctx: &'ctx mut TestingContext, format: TextureFormat) -> Self { let extra_usages = match format { TextureFormat::Depth24Plus | TextureFormat::Depth24PlusStencil8 => {