-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix incorrect SamplerParams operators #7150
Conversation
@@ -838,6 +838,7 @@ struct SamplerParams { // NOLINT | |||
return SamplerParams::LessThan{}(lhs, rhs); | |||
} | |||
}; | |||
static_assert(sizeof(SamplerParams) == 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -813,22 +813,22 @@ struct SamplerParams { // NOLINT | |||
struct Hasher { | |||
size_t operator()(SamplerParams p) const noexcept { | |||
// we don't use std::hash<> here, so we don't have to include <functional> | |||
return *reinterpret_cast<uint64_t const*>(reinterpret_cast<char const*>(&p)); | |||
return *reinterpret_cast<uint32_t const*>(reinterpret_cast<char const*>(&p)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any conflict with #7104 ?
This was causing the OpenGL backend to assert on x86_64 Macs:
It seems it's not just an OpenGL
backend issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#7104 was the cause of the bug, yes. And certainly this could affect backends other than OpenGL, but the assert that was firing was specific to the OpenGL backend.
This was causing the OpenGL backend to assert on x86_64 Macs: