Support comparing wgpu objects by comparing underlying pointers
This commit is contained in:
parent
24f3df6f35
commit
08510e265b
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue