From 08510e265b305a3e2a4d702c75f76ffef909c7fa Mon Sep 17 00:00:00 2001 From: lisyarus Date: Thu, 5 Jun 2025 18:47:38 +0300 Subject: [PATCH] Support comparing wgpu objects by comparing underlying pointers --- libs/wgpu/include/psemek/wgpu/detail/object.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/wgpu/include/psemek/wgpu/detail/object.hpp b/libs/wgpu/include/psemek/wgpu/detail/object.hpp index 887acdff..2e3586b6 100644 --- a/libs/wgpu/include/psemek/wgpu/detail/object.hpp +++ b/libs/wgpu/include/psemek/wgpu/detail/object.hpp @@ -55,6 +55,11 @@ namespace psemek::wgpu::detail explicit operator bool() const { return ptr_ != nullptr; } + friend bool operator == (object const & o1, object const & o2) + { + return o1.ptr_ == o2.ptr_; + } + protected: object(void * ptr) : ptr_(ptr)