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/gpu/gpu.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gpu/gpu.h') diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h index b52d6ab..74e0eb7 100644 --- a/src/gpu/gpu.h +++ b/src/gpu/gpu.h @@ -99,6 +99,9 @@ TextureWithView gpu_create_storage_texture_2d(WGPUDevice device, uint32_t width, WGPUTextureFormat format); WGPUTextureView gpu_create_mip_view(WGPUTexture texture, WGPUTextureFormat format, uint32_t mip_level); +WGPUTextureView gpu_create_texture_view_2d(WGPUTexture texture, + WGPUTextureFormat format, + uint32_t mip_levels = 1); ComputePass gpu_create_compute_pass(WGPUDevice device, const char* shader_code, ResourceBinding* bindings, int num_bindings); -- cgit v1.2.3