From 61ced8aa1946cc32de4328cc75b5faf6b77723be Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 14 Feb 2026 14:03:58 +0100 Subject: Refactor: add gpu_create_texture_view_2d helper Reduces WGPUTextureViewDescriptor boilerplate from 5-7 lines to 1-2. Helper supports optional mip_levels parameter (defaults to 1). Updated 17 call sites across gpu/, tests/, and tools/. Net: -82 lines. All tests passing (34/34). Co-Authored-By: Claude Sonnet 4.5 --- src/tests/gpu/test_post_process_helper.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/tests/gpu/test_post_process_helper.cc') diff --git a/src/tests/gpu/test_post_process_helper.cc b/src/tests/gpu/test_post_process_helper.cc index 13fd856..08b9e49 100644 --- a/src/tests/gpu/test_post_process_helper.cc +++ b/src/tests/gpu/test_post_process_helper.cc @@ -38,15 +38,7 @@ static WGPUTexture create_post_process_texture(WGPUDevice device, int width, // Helper: Create texture view static WGPUTextureView create_texture_view(WGPUTexture texture, WGPUTextureFormat format) { - const WGPUTextureViewDescriptor view_desc = { - .format = format, - .dimension = WGPUTextureViewDimension_2D, - .baseMipLevel = 0, - .mipLevelCount = 1, - .baseArrayLayer = 0, - .arrayLayerCount = 1, - }; - return wgpuTextureCreateView(texture, &view_desc); + return gpu_create_texture_view_2d(texture, format); } // Minimal valid post-process shader for testing -- cgit v1.2.3