On Thu, 12 May 2022 at 02:04, James McDonnell topgamer7@gmail.com wrote:
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState1(ID3D11Device2 *iface,
const D3D11_BLEND_DESC1 *desc, ID3D11BlendState1 **state)
const D3D11_BLEND_DESC1 *desc, ID3D11BlendState1 **blend_state)
{
- FIXME("iface %p, desc %p, state %p stub!\n", iface, desc, state);
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_blend_state *object;
- HRESULT hr;
- unsigned i, j;
- D3D11_BLEND_DESC simple_desc;
- return E_NOTIMPL;
- TRACE("iface %p, desc %p, blend_state %p.\n", iface, desc, blend_state);
- FIXME("Logical operations are not implemented.\n");
- memset(&simple_desc, 0, sizeof(simple_desc));
- simple_desc.AlphaToCoverageEnable = desc->AlphaToCoverageEnable;
- simple_desc.IndependentBlendEnable = desc->IndependentBlendEnable;
- for (i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
- {
j = desc->IndependentBlendEnable ? i : 0;
simple_desc.RenderTarget[i].BlendEnable = desc->RenderTarget[j].BlendEnable;
simple_desc.RenderTarget[i].SrcBlend = desc->RenderTarget[j].SrcBlend;
simple_desc.RenderTarget[i].DestBlend = desc->RenderTarget[j].DestBlend;
simple_desc.RenderTarget[i].BlendOp = desc->RenderTarget[j].BlendOp;
simple_desc.RenderTarget[i].SrcBlendAlpha = desc->RenderTarget[j].SrcBlendAlpha;
simple_desc.RenderTarget[i].DestBlendAlpha = desc->RenderTarget[j].DestBlendAlpha;
simple_desc.RenderTarget[i].BlendOpAlpha = desc->RenderTarget[j].BlendOpAlpha;
simple_desc.RenderTarget[i].RenderTargetWriteMask = desc->RenderTarget[j].RenderTargetWriteMask;
- }
- if (FAILED(hr = d3d_blend_state_create(device, &simple_desc, &object)))
return hr;
- *blend_state = (ID3D11BlendState1*)&object->ID3D11BlendState1_iface;
- return S_OK;
}
I think at the very least, this patch should modify d3d_blend_state_create() to take a D3D11_BLEND_DESC1 structure instead of a D3D11_BLEND_DESC structure, and store it in the d3d_blend_state structure, so that d3d11_blend_state_GetDesc1() can be properly implemented. Ideally there would then also be a follow-up patch to handle the new fields in wined3d for both the OpenGL and Vulkan backends.