mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-29 00:33:01 +00:00
commit
e8088d1216
@ -156,6 +156,35 @@ inline D3D12_BLEND getBlendFactor(u16 factor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert GCM blend factor code to D3D12 one for alpha component
|
||||
*/
|
||||
inline D3D12_BLEND getBlendFactorAlpha(u16 factor)
|
||||
{
|
||||
switch (factor)
|
||||
{
|
||||
case CELL_GCM_ZERO: return D3D12_BLEND_ZERO;
|
||||
case CELL_GCM_ONE: return D3D12_BLEND_ONE;
|
||||
case CELL_GCM_SRC_COLOR: return D3D12_BLEND_SRC_ALPHA;
|
||||
case CELL_GCM_ONE_MINUS_SRC_COLOR: return D3D12_BLEND_INV_SRC_ALPHA;
|
||||
case CELL_GCM_SRC_ALPHA: return D3D12_BLEND_SRC_ALPHA;
|
||||
case CELL_GCM_ONE_MINUS_SRC_ALPHA: return D3D12_BLEND_INV_SRC_ALPHA;
|
||||
case CELL_GCM_DST_ALPHA: return D3D12_BLEND_DEST_ALPHA;
|
||||
case CELL_GCM_ONE_MINUS_DST_ALPHA: return D3D12_BLEND_INV_DEST_ALPHA;
|
||||
case CELL_GCM_DST_COLOR: return D3D12_BLEND_DEST_ALPHA;
|
||||
case CELL_GCM_ONE_MINUS_DST_COLOR: return D3D12_BLEND_INV_DEST_COLOR;
|
||||
case CELL_GCM_SRC_ALPHA_SATURATE: return D3D12_BLEND_INV_DEST_ALPHA;
|
||||
default:
|
||||
case CELL_GCM_CONSTANT_COLOR:
|
||||
case CELL_GCM_ONE_MINUS_CONSTANT_COLOR:
|
||||
case CELL_GCM_CONSTANT_ALPHA:
|
||||
case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA:
|
||||
LOG_WARNING(RSX, "Unsupported Blend Factor %d", factor);
|
||||
return D3D12_BLEND();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert GCM logic op code to D3D12 one
|
||||
*/
|
||||
|
@ -123,31 +123,31 @@ bool D3D12GSRender::LoadProgram()
|
||||
{
|
||||
prop.Blend.RenderTarget[0].SrcBlend = getBlendFactor(m_blend_sfactor_rgb);
|
||||
prop.Blend.RenderTarget[0].DestBlend = getBlendFactor(m_blend_dfactor_rgb);
|
||||
prop.Blend.RenderTarget[0].SrcBlendAlpha = getBlendFactor(m_blend_sfactor_alpha);
|
||||
prop.Blend.RenderTarget[0].DestBlendAlpha = getBlendFactor(m_blend_dfactor_alpha);
|
||||
prop.Blend.RenderTarget[0].SrcBlendAlpha = getBlendFactorAlpha(m_blend_sfactor_alpha);
|
||||
prop.Blend.RenderTarget[0].DestBlendAlpha = getBlendFactorAlpha(m_blend_dfactor_alpha);
|
||||
|
||||
if (m_set_blend_mrt1)
|
||||
{
|
||||
prop.Blend.RenderTarget[1].SrcBlend = getBlendFactor(m_blend_sfactor_rgb);
|
||||
prop.Blend.RenderTarget[1].DestBlend = getBlendFactor(m_blend_dfactor_rgb);
|
||||
prop.Blend.RenderTarget[1].SrcBlendAlpha = getBlendFactor(m_blend_sfactor_alpha);
|
||||
prop.Blend.RenderTarget[1].DestBlendAlpha = getBlendFactor(m_blend_dfactor_alpha);
|
||||
prop.Blend.RenderTarget[1].SrcBlendAlpha = getBlendFactorAlpha(m_blend_sfactor_alpha);
|
||||
prop.Blend.RenderTarget[1].DestBlendAlpha = getBlendFactorAlpha(m_blend_dfactor_alpha);
|
||||
}
|
||||
|
||||
if (m_set_blend_mrt2)
|
||||
{
|
||||
prop.Blend.RenderTarget[2].SrcBlend = getBlendFactor(m_blend_sfactor_rgb);
|
||||
prop.Blend.RenderTarget[2].DestBlend = getBlendFactor(m_blend_dfactor_rgb);
|
||||
prop.Blend.RenderTarget[2].SrcBlendAlpha = getBlendFactor(m_blend_sfactor_alpha);
|
||||
prop.Blend.RenderTarget[2].DestBlendAlpha = getBlendFactor(m_blend_dfactor_alpha);
|
||||
prop.Blend.RenderTarget[2].SrcBlendAlpha = getBlendFactorAlpha(m_blend_sfactor_alpha);
|
||||
prop.Blend.RenderTarget[2].DestBlendAlpha = getBlendFactorAlpha(m_blend_dfactor_alpha);
|
||||
}
|
||||
|
||||
if (m_set_blend_mrt3)
|
||||
{
|
||||
prop.Blend.RenderTarget[3].SrcBlend = getBlendFactor(m_blend_sfactor_rgb);
|
||||
prop.Blend.RenderTarget[3].DestBlend = getBlendFactor(m_blend_dfactor_rgb);
|
||||
prop.Blend.RenderTarget[3].SrcBlendAlpha = getBlendFactor(m_blend_sfactor_alpha);
|
||||
prop.Blend.RenderTarget[3].DestBlendAlpha = getBlendFactor(m_blend_dfactor_alpha);
|
||||
prop.Blend.RenderTarget[3].SrcBlendAlpha = getBlendFactorAlpha(m_blend_sfactor_alpha);
|
||||
prop.Blend.RenderTarget[3].DestBlendAlpha = getBlendFactorAlpha(m_blend_dfactor_alpha);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user