Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extent2D and Extent3D should implement IEquatable #2276

Open
StefanPoelloth opened this issue Sep 5, 2024 · 0 comments
Open

Extent2D and Extent3D should implement IEquatable #2276

StefanPoelloth opened this issue Sep 5, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@StefanPoelloth
Copy link

Summary of feature

Silk.NET.Vulkan.Extent2D and Silk.NET.Vulkan.Extent3D should implement IEquatable.

Comments

There might be other structs that would benefit from the implementation.

In my code I'm comparing 2 Silk.NET.Vulkan.Extent2D with currentSize.Equals(displaySize) to check if some resources should be recreated.
As a workaround i changed my code to compare the individual fields.

Output from resharper code inspection:

warning: Struct 'Extent2D' is checked for equality using the inefficient runtime-provided implementation
Default implementations of the 'Equals' and 'GetHashCode' methods of a struct are reflection-based and bad-performing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants