[PATCH 08/11] d3d11: Introduce a function to convert D3D11 blend factors to wined3d.

Chip Davis cdavis at codeweavers.com
Fri Apr 3 11:06:02 CDT 2020


Signed-off-by: Chip Davis <cdavis at codeweavers.com>
---
 dlls/d3d11/state.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c
index 9170986b1c9..af377424c2d 100644
--- a/dlls/d3d11/state.c
+++ b/dlls/d3d11/state.c
@@ -313,6 +313,11 @@ static const struct wined3d_parent_ops d3d_blend_state_wined3d_parent_ops =
     d3d_blend_state_wined3d_object_destroyed,
 };
 
+static enum wined3d_blend wined3d_blend_from_d3d11(D3D11_BLEND factor)
+{
+    return (enum wined3d_blend)factor;
+}
+
 HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC *desc,
         struct d3d_blend_state **state)
 {
@@ -395,11 +400,11 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
     for (i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
     {
         wined3d_desc.rt[i].enable = desc->RenderTarget[i].BlendEnable;
-        wined3d_desc.rt[i].src = desc->RenderTarget[i].SrcBlend;
-        wined3d_desc.rt[i].dst = desc->RenderTarget[i].DestBlend;
+        wined3d_desc.rt[i].src = wined3d_blend_from_d3d11(desc->RenderTarget[i].SrcBlend);
+        wined3d_desc.rt[i].dst = wined3d_blend_from_d3d11(desc->RenderTarget[i].DestBlend);
         wined3d_desc.rt[i].op = desc->RenderTarget[i].BlendOp;
-        wined3d_desc.rt[i].src_alpha = desc->RenderTarget[i].SrcBlendAlpha;
-        wined3d_desc.rt[i].dst_alpha = desc->RenderTarget[i].DestBlendAlpha;
+        wined3d_desc.rt[i].src_alpha = wined3d_blend_from_d3d11(desc->RenderTarget[i].SrcBlendAlpha);
+        wined3d_desc.rt[i].dst_alpha = wined3d_blend_from_d3d11(desc->RenderTarget[i].DestBlendAlpha);
         wined3d_desc.rt[i].op_alpha = desc->RenderTarget[i].BlendOpAlpha;
         wined3d_desc.rt[i].writemask = desc->RenderTarget[i].RenderTargetWriteMask;
     }
-- 
2.24.0




More information about the wine-devel mailing list