D3D: State cache now reduces number of blend state permutations by collapsing some states that have blending disabled
This commit is contained in:
parent
bea68c95a4
commit
9bdfd4a833
|
@ -172,6 +172,14 @@ ID3D11SamplerState* StateCache::Get(SamplerState state)
|
|||
|
||||
ID3D11BlendState* StateCache::Get(BlendState state)
|
||||
{
|
||||
if (!state.blend_enable)
|
||||
{
|
||||
state.src_blend = D3D11_BLEND_ONE;
|
||||
state.dst_blend = D3D11_BLEND_ZERO;
|
||||
state.blend_op = D3D11_BLEND_OP_ADD;
|
||||
state.use_dst_alpha = false;
|
||||
}
|
||||
|
||||
auto it = m_blend.find(state.packed);
|
||||
|
||||
if (it != m_blend.end())
|
||||
|
|
Loading…
Reference in New Issue