From d806027dcaeadcdd8d2febd88bc46b2fd2c465de Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 21 May 2026 08:10:47 +0200 Subject: style: apply clang-format --- src/gpu/gpu.cc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/gpu/gpu.cc') diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc index f5f1515..3200655 100644 --- a/src/gpu/gpu.cc +++ b/src/gpu/gpu.cc @@ -138,14 +138,18 @@ WGPUShaderModule gpu_create_shader_module(WGPUDevice device, } WGPUSampler gpu_create_linear_sampler(WGPUDevice device) { - WGPUSampler s = SamplerCache::Get().get_or_create(device, SamplerCache::clamp()); - if (s) wgpuSamplerAddRef(s); // Caller owns a reference (for RAII wrappers) + WGPUSampler s = + SamplerCache::Get().get_or_create(device, SamplerCache::clamp()); + if (s) + wgpuSamplerAddRef(s); // Caller owns a reference (for RAII wrappers) return s; } WGPUSampler gpu_create_nearest_sampler(WGPUDevice device) { - WGPUSampler s = SamplerCache::Get().get_or_create(device, SamplerCache::nearest()); - if (s) wgpuSamplerAddRef(s); // Caller owns a reference (for RAII wrappers) + WGPUSampler s = + SamplerCache::Get().get_or_create(device, SamplerCache::nearest()); + if (s) + wgpuSamplerAddRef(s); // Caller owns a reference (for RAII wrappers) return s; } @@ -170,8 +174,8 @@ RenderPass gpu_create_render_pass(WGPUDevice device, WGPUTextureFormat format, // Compose shader to resolve #include directives std::string composed_shader = ShaderComposer::Get().Compose({}, shader_code); - WGPUShaderModule shader_module = - gpu_create_shader_module(device, composed_shader.c_str(), "render_shader"); + WGPUShaderModule shader_module = gpu_create_shader_module( + device, composed_shader.c_str(), "render_shader"); // Create Bind Group Layout & Bind Group std::vector bgl_entries; @@ -268,8 +272,8 @@ ComputePass gpu_create_compute_pass(WGPUDevice device, const char* shader_code, // Compose shader to resolve #include directives std::string composed_shader = ShaderComposer::Get().Compose({}, shader_code); - WGPUShaderModule shader_module = - gpu_create_shader_module(device, composed_shader.c_str(), "compute_shader"); + WGPUShaderModule shader_module = gpu_create_shader_module( + device, composed_shader.c_str(), "compute_shader"); std::vector bgl_entries; std::vector bg_entries; @@ -379,7 +383,7 @@ void gpu_init(PlatformState* platform_state) { // Exclude GL backend: wgpu's WGL pixel-format selection panics under Wine. WGPUInstanceExtras win_extras = {}; win_extras.chain.sType = (WGPUSType)WGPUSType_InstanceExtras; - win_extras.backends = WGPUInstanceBackend_Primary; // Vulkan + DX12, no GL + win_extras.backends = WGPUInstanceBackend_Primary; // Vulkan + DX12, no GL WGPUInstanceDescriptor win_desc = {}; win_desc.nextInChain = (WGPUChainedStruct*)&win_extras; g_instance = wgpuCreateInstance(&win_desc); @@ -435,7 +439,6 @@ void gpu_init(PlatformState* platform_state) { wgpuSurfaceConfigure(g_surface, &g_config); InitShaderComposer(); - } void gpu_resize(int width, int height) { -- cgit v1.2.3