|
|
@@ -2485,31 +2485,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|
|
{
|
|
|
_state &= BGFX_D3D11_BLEND_STATE_MASK;
|
|
|
|
|
|
- bx::HashMurmur2A murmur;
|
|
|
- murmur.begin();
|
|
|
- murmur.add(_state);
|
|
|
-
|
|
|
- const uint64_t f0 = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_FACTOR, BGFX_STATE_BLEND_FACTOR);
|
|
|
- const uint64_t f1 = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_INV_FACTOR, BGFX_STATE_BLEND_INV_FACTOR);
|
|
|
- bool hasFactor = f0 == (_state & f0)
|
|
|
- || f1 == (_state & f1)
|
|
|
- ;
|
|
|
-
|
|
|
- float blendFactor[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
|
|
- if (hasFactor)
|
|
|
- {
|
|
|
- blendFactor[0] = ( (_rgba>>24) )/255.0f;
|
|
|
- blendFactor[1] = ( (_rgba>>16)&0xff)/255.0f;
|
|
|
- blendFactor[2] = ( (_rgba>> 8)&0xff)/255.0f;
|
|
|
- blendFactor[3] = ( (_rgba )&0xff)/255.0f;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- murmur.add(_rgba);
|
|
|
- }
|
|
|
-
|
|
|
- uint32_t hash = murmur.end();
|
|
|
-
|
|
|
+ const uint64_t hash = _state;
|
|
|
ID3D11BlendState* bs = m_blendStateCache.find(hash);
|
|
|
if (NULL == bs)
|
|
|
{
|
|
|
@@ -2587,6 +2563,22 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|
|
m_blendStateCache.add(hash, bs);
|
|
|
}
|
|
|
|
|
|
+ const uint64_t f0 = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_FACTOR, BGFX_STATE_BLEND_FACTOR);
|
|
|
+ const uint64_t f1 = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_INV_FACTOR, BGFX_STATE_BLEND_INV_FACTOR);
|
|
|
+ bool hasFactor = false
|
|
|
+ || f0 == (_state & f0)
|
|
|
+ || f1 == (_state & f1)
|
|
|
+ ;
|
|
|
+
|
|
|
+ float blendFactor[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
|
|
+ if (hasFactor)
|
|
|
+ {
|
|
|
+ blendFactor[0] = ( (_rgba>>24) )/255.0f;
|
|
|
+ blendFactor[1] = ( (_rgba>>16)&0xff)/255.0f;
|
|
|
+ blendFactor[2] = ( (_rgba>> 8)&0xff)/255.0f;
|
|
|
+ blendFactor[3] = ( (_rgba )&0xff)/255.0f;
|
|
|
+ }
|
|
|
+
|
|
|
m_deviceCtx->OMSetBlendState(bs, blendFactor, 0xffffffff);
|
|
|
}
|
|
|
|