Skip to content

Commit

Permalink
compatibility fix for the clang compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
turanszkij committed Jan 28, 2025
1 parent 0dc0ede commit 2aa34e5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion WickedEngine/wiGraphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,14 @@ namespace wi::graphics
}
constexpr uint64_t get_hash() const
{
return (uint64_t(pso) ^ (renderpass_hash << 1)) >> 1;
union
{
const PipelineState* ptr;
uint64_t value;
} pso_hasher = {};
static_assert(sizeof(pso_hasher) == sizeof(uint64_t));
pso_hasher.ptr = pso; // reinterpret_cast in constexpr workaround
return (pso_hasher.value ^ (renderpass_hash << 1)) >> 1;
}
};

Expand Down

0 comments on commit 2aa34e5

Please sign in to comment.