From 34afbd6ca21d2b960573d787e6eae46fa86b200e Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 5 Mar 2026 22:55:56 +0100 Subject: style: run clang-format to adhere to coding style --- src/gpu/wgpu_resource.h | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'src/gpu/wgpu_resource.h') diff --git a/src/gpu/wgpu_resource.h b/src/gpu/wgpu_resource.h index e448b18..e12aa45 100644 --- a/src/gpu/wgpu_resource.h +++ b/src/gpu/wgpu_resource.h @@ -11,11 +11,14 @@ #include "platform/platform.h" #include "util/fatal_error.h" -template -class WGPUResource { +template class WGPUResource { public: - WGPUResource() : ptr_(nullptr) {} - ~WGPUResource() { if (ptr_) Release(ptr_); } + WGPUResource() : ptr_(nullptr) { + } + ~WGPUResource() { + if (ptr_) + Release(ptr_); + } void set(T ptr) { FATAL_ASSERT(ptr_ == nullptr); @@ -23,12 +26,17 @@ class WGPUResource { } void replace(T ptr) { - if (ptr_) Release(ptr_); + if (ptr_) + Release(ptr_); ptr_ = ptr; } - T get() const { return ptr_; } - T* get_address() { return &ptr_; } + T get() const { + return ptr_; + } + T* get_address() { + return &ptr_; + } private: T ptr_; @@ -37,8 +45,10 @@ class WGPUResource { }; using BindGroup = WGPUResource; -using RenderPipeline = WGPUResource; -using ComputePipeline = WGPUResource; +using RenderPipeline = + WGPUResource; +using ComputePipeline = + WGPUResource; using Sampler = WGPUResource; using Texture = WGPUResource; using TextureView = WGPUResource; -- cgit v1.2.3