diff options
Diffstat (limited to 'src/tests/gpu/test_post_process_helper.cc')
| -rw-r--r-- | src/tests/gpu/test_post_process_helper.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/tests/gpu/test_post_process_helper.cc b/src/tests/gpu/test_post_process_helper.cc index 42b5d79..575291d 100644 --- a/src/tests/gpu/test_post_process_helper.cc +++ b/src/tests/gpu/test_post_process_helper.cc @@ -2,10 +2,10 @@ // It tests post-processing helper functions (pipeline and bind group creation). // Validates that helpers can create valid WebGPU resources. -#include "gpu/demo_effects.h" -#include "gpu/gpu.h" #include "../common/offscreen_render_target.h" #include "../common/webgpu_test_fixture.h" +#include "gpu/demo_effects.h" +#include "gpu/gpu.h" #include <cassert> #include <cstdio> @@ -15,10 +15,11 @@ extern WGPURenderPipeline create_post_process_pipeline(WGPUDevice device, const char* shader_code); extern void pp_update_bind_group(WGPUDevice device, WGPURenderPipeline pipeline, WGPUBindGroup* bind_group, - WGPUTextureView input_view, - GpuBuffer uniforms, GpuBuffer effect_params); + WGPUTextureView input_view, GpuBuffer uniforms, + GpuBuffer effect_params); -// Helpers are now in gpu.h (gpu_create_post_process_texture, gpu_create_texture_view_2d) +// Helpers are now in gpu.h (gpu_create_post_process_texture, +// gpu_create_texture_view_2d) // Minimal valid post-process shader for testing static const char* test_shader = R"( @@ -66,8 +67,8 @@ static void test_bind_group_creation(WebGPUTestFixture& fixture) { assert(pipeline != nullptr && "Pipeline required for bind group test"); // Create input texture with TEXTURE_BINDING usage - TextureWithView input = - gpu_create_post_process_texture(fixture.device(), 256, 256, fixture.format()); + TextureWithView input = gpu_create_post_process_texture( + fixture.device(), 256, 256, fixture.format()); // Create uniform buffers using gpu_create_buffer GpuBuffer uniforms = gpu_create_buffer( @@ -103,10 +104,10 @@ static void test_bind_group_update(WebGPUTestFixture& fixture) { WGPURenderPipeline pipeline = create_post_process_pipeline( fixture.device(), fixture.format(), test_shader); - TextureWithView texture1 = - gpu_create_post_process_texture(fixture.device(), 256, 256, fixture.format()); - TextureWithView texture2 = - gpu_create_post_process_texture(fixture.device(), 512, 512, fixture.format()); + TextureWithView texture1 = gpu_create_post_process_texture( + fixture.device(), 256, 256, fixture.format()); + TextureWithView texture2 = gpu_create_post_process_texture( + fixture.device(), 512, 512, fixture.format()); GpuBuffer uniforms = gpu_create_buffer( fixture.device(), 16, WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst); @@ -150,8 +151,8 @@ static void test_full_setup(WebGPUTestFixture& fixture) { assert(pipeline != nullptr && "Pipeline creation failed"); // Create input texture (with TEXTURE_BINDING usage) - TextureWithView input = - gpu_create_post_process_texture(fixture.device(), 256, 256, fixture.format()); + TextureWithView input = gpu_create_post_process_texture( + fixture.device(), 256, 256, fixture.format()); // Create output texture (can use OffscreenRenderTarget for this) OffscreenRenderTarget output_target(fixture.instance(), fixture.device(), 256, |
