From 12f83d4615a38cb0b1ed8a3eb436c4acca170479 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 14 Feb 2026 14:15:07 +0100 Subject: Refactor: add gpu_create_post_process_texture helper Adds new helper for common post-process texture pattern (RenderAttachment | TextureBinding | CopySrc usage). Refactors test_post_process_helper.cc to use gpu_create_buffer() and gpu_create_post_process_texture(), eliminating 91 lines of boilerplate. - New: gpu_create_post_process_texture() in gpu.{h,cc} - Refactor: test_post_process_helper.cc uses helpers instead of raw WGPU - Doc: Updated WGPU_HELPERS.md with usage examples - Verified: All tests passing (test_post_process_helper, test_demo_effects) 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 74e0eb7..0b0153b 100644 --- a/src/gpu/gpu.h +++ b/src/gpu/gpu.h @@ -97,6 +97,9 @@ TextureWithView gpu_create_texture_2d(WGPUDevice device, uint32_t width, TextureWithView gpu_create_storage_texture_2d(WGPUDevice device, uint32_t width, uint32_t height, WGPUTextureFormat format); +TextureWithView gpu_create_post_process_texture(WGPUDevice device, + uint32_t width, uint32_t height, + WGPUTextureFormat format); WGPUTextureView gpu_create_mip_view(WGPUTexture texture, WGPUTextureFormat format, uint32_t mip_level); WGPUTextureView gpu_create_texture_view_2d(WGPUTexture texture, -- cgit v1.2.3