d3d11: Introduce a function to convert D3D11 blend factors to D3D10.

Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Chip Davis 2020-04-08 01:11:36 -05:00 committed by Alexandre Julliard
parent e9d2b31c87
commit c939699dea
1 changed files with 9 additions and 4 deletions

View File

@ -240,6 +240,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateDataInterface(ID3D1
/* ID3D10BlendState methods */
static D3D10_BLEND d3d10_blend_from_d3d11(D3D11_BLEND factor)
{
return (D3D10_BLEND)factor;
}
static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc(ID3D10BlendState1 *iface, D3D10_BLEND_DESC *desc)
{
struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface);
@ -249,11 +254,11 @@ static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc(ID3D10BlendState1 *iface
TRACE("iface %p, desc %p.\n", iface, desc);
desc->AlphaToCoverageEnable = d3d11_desc->AlphaToCoverageEnable;
desc->SrcBlend = d3d11_desc->RenderTarget[0].SrcBlend;
desc->DestBlend = d3d11_desc->RenderTarget[0].DestBlend;
desc->SrcBlend = d3d10_blend_from_d3d11(d3d11_desc->RenderTarget[0].SrcBlend);
desc->DestBlend = d3d10_blend_from_d3d11(d3d11_desc->RenderTarget[0].DestBlend);
desc->BlendOp = d3d11_desc->RenderTarget[0].BlendOp;
desc->SrcBlendAlpha = d3d11_desc->RenderTarget[0].SrcBlendAlpha;
desc->DestBlendAlpha = d3d11_desc->RenderTarget[0].DestBlendAlpha;
desc->SrcBlendAlpha = d3d10_blend_from_d3d11(d3d11_desc->RenderTarget[0].SrcBlendAlpha);
desc->DestBlendAlpha = d3d10_blend_from_d3d11(d3d11_desc->RenderTarget[0].DestBlendAlpha);
desc->BlendOpAlpha = d3d11_desc->RenderTarget[0].BlendOpAlpha;
for (i = 0; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
{