Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
BlendingProperties.cpp
Go to the documentation of this file.
1
2
4
5namespace Divide {
6
7 [[nodiscard]] size_t GetHash(const BlendingSettings& properties) {
8 size_t hash = 1337;
9 Util::Hash_combine(hash, properties.enabled(),
10 properties.blendSrc(),
11 properties.blendDest(),
12 properties.blendOp(),
13 properties.blendSrcAlpha(),
14 properties.blendDestAlpha(),
15 properties.blendOpAlpha());
16
17 return hash;
18 }
19
20 [[nodiscard]] size_t GetHash(const RTBlendStates& blendStates) {
21 size_t hash = 1333377;
22 Util::Hash_combine(hash, blendStates._blendColour.r,
23 blendStates._blendColour.g,
24 blendStates._blendColour.b,
25 blendStates._blendColour.a);
26
27 for (const BlendingSettings& state : blendStates._settings) {
28 Util::Hash_combine(hash, GetHash(state));
29 }
30 return hash;
31 }
32
33}; //namespace Divide
void Hash_combine(size_t &seed, const T &v, const Rest &... rest) noexcept
a la Boost
Definition: MathHelper.inl:799
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
size_t GetHash(const PropertyDescriptor< T > &descriptor) noexcept
Definition: Resource.inl:40
std::array< BlendingSettings, to_base(RTColourAttachmentSlot::COUNT)> _settings