[PATCH] d3d11: OMSetBlendState blend states is optional

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Thu Nov 19 03:09:10 CST 2015


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/d3d11/device.c      | 7 ++++++-
 dlls/d3d11/tests/d3d11.c | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index f2bc4d6..c6e54cf 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -603,10 +603,15 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetRenderTargetsAndUnord
 }
 
 static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11DeviceContext *iface,
-        ID3D11BlendState *blend_state, const FLOAT blend_factor[4], UINT sample_mask)
+        ID3D11BlendState *blend_state, const FLOAT arg_blend_factor[4], UINT sample_mask)
 {
     struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
     const D3D11_BLEND_DESC *desc;
+    const FLOAT blend_default[4] = {1.0f, 1.0f, 1.0f, 1.0f};
+    const FLOAT *blend_factor = blend_default;
+
+    if(arg_blend_factor)
+        blend_factor = arg_blend_factor;
 
     TRACE("iface %p, blend_state %p, blend_factor {%.8e %.8e %.8e %.8e}, sample_mask 0x%08x.\n",
             iface, blend_state, blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3], sample_mask);
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 7021c6f..3f26698 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -2777,6 +2777,8 @@ static void test_blend(void)
 
     ID3D11DeviceContext_ClearRenderTargetView(context, backbuffer_rtv, red);
 
+    ID3D11DeviceContext_OMSetBlendState(context, src_blend, NULL, D3D11_DEFAULT_SAMPLE_MASK);
+    ID3D11DeviceContext_Draw(context, 4, 0);
     ID3D11DeviceContext_OMSetBlendState(context, src_blend, blend_factor, D3D11_DEFAULT_SAMPLE_MASK);
     ID3D11DeviceContext_Draw(context, 4, 0);
     ID3D11DeviceContext_OMSetBlendState(context, dst_blend, blend_factor, D3D11_DEFAULT_SAMPLE_MASK);
-- 
2.6.2




More information about the wine-patches mailing list