[PATCH 1/5] wined3d: Move the destination blend state to wined3d_blend_state.

Zebediah Figura z.figura12 at gmail.com
Tue Mar 10 18:06:15 CDT 2020


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/d3d11/device.c    | 1 -
 dlls/d3d11/state.c     | 1 +
 dlls/wined3d/device.c  | 2 ++
 dlls/wined3d/state.c   | 7 ++-----
 include/wine/wined3d.h | 1 +
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index e09527d5a7..2a764897a9 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -740,7 +740,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
     {
         const D3D11_RENDER_TARGET_BLEND_DESC *d = &desc->RenderTarget[0];
 
-        wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLEND, d->DestBlend);
         wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOP, d->BlendOp);
         wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SEPARATEALPHABLENDENABLE, TRUE);
         wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SRCBLENDALPHA, d->SrcBlendAlpha);
diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c
index 1cc579c86a..4d5bd8d94e 100644
--- a/dlls/d3d11/state.c
+++ b/dlls/d3d11/state.c
@@ -391,6 +391,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
     wined3d_desc.alpha_to_coverage = desc->AlphaToCoverageEnable;
     wined3d_desc.enable = desc->RenderTarget[0].BlendEnable;
     wined3d_desc.src = desc->RenderTarget[0].SrcBlend;
+    wined3d_desc.dst = desc->RenderTarget[0].DestBlend;
 
     /* We cannot fail after creating a wined3d_blend_state object. It
      * would lead to double free. */
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 54efdb05a7..d7175284cf 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3583,6 +3583,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
                 case WINED3D_RS_BLENDFACTOR:
                 case WINED3D_RS_ALPHABLENDENABLE:
                 case WINED3D_RS_SRCBLEND:
+                case WINED3D_RS_DESTBLEND:
                     set_blend_state = TRUE;
                     break;
 
@@ -3655,6 +3656,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
             desc.alpha_to_coverage = TRUE;
         desc.enable = state->rs[WINED3D_RS_ALPHABLENDENABLE];
         desc.src = state->rs[WINED3D_RS_SRCBLEND];
+        desc.dst = state->rs[WINED3D_RS_DESTBLEND];
 
         if (wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_BLENDFACTOR))
             wined3d_color_from_d3dcolor(&colour, state->rs[WINED3D_RS_BLENDFACTOR]);
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index aa85193bdd..8de2945bf5 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -557,8 +557,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st
     gl_info->gl_ops.gl.p_glEnable(GL_BLEND);
     checkGLcall("glEnable(GL_BLEND)");
 
-    gl_blend_from_d3d(&src_blend, &dst_blend, b->desc.src,
-            state->render_states[WINED3D_RS_DESTBLEND], rt_format);
+    gl_blend_from_d3d(&src_blend, &dst_blend, b->desc.src, b->desc.dst, rt_format);
 
     /* Re-apply BLENDOP(ALPHA) because of a possible SEPARATEALPHABLENDENABLE change */
     if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_BLENDOP)))
@@ -4503,7 +4502,6 @@ const struct wined3d_state_entry_template misc_state_template[] =
     { STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING,        { STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING,        state_uav_warn      }, WINED3D_GL_EXT_NONE             },
     { STATE_STREAM_OUTPUT,                                { STATE_STREAM_OUTPUT,                                state_so,           }, WINED3D_GL_VERSION_3_2          },
     { STATE_STREAM_OUTPUT,                                { STATE_STREAM_OUTPUT,                                state_so_warn,      }, WINED3D_GL_EXT_NONE             },
-    { STATE_RENDER(WINED3D_RS_DESTBLEND),                 { STATE_BLEND,                                        NULL                }, WINED3D_GL_EXT_NONE             },
     { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS),             { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS),             state_line_antialias}, WINED3D_GL_EXT_NONE             },
     { STATE_RENDER(WINED3D_RS_SEPARATEALPHABLENDENABLE),  { STATE_BLEND,                                        NULL                }, WINED3D_GL_EXT_NONE             },
     { STATE_RENDER(WINED3D_RS_SRCBLENDALPHA),             { STATE_BLEND,                                        NULL                }, WINED3D_GL_EXT_NONE             },
@@ -5417,8 +5415,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table)
         {  1,   1},
         {  3,   3},
         {  8,   8},
-        { 17,  19},
-        { 21,  22},
+        { 17,  22},
         { 27,  27},
         { 42,  45},
         { 47,  47},
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 923f184d96..4473da13dd 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2031,6 +2031,7 @@ struct wined3d_blend_state_desc
     BOOL alpha_to_coverage;
     BOOL enable;
     enum wined3d_blend src;
+    enum wined3d_blend dst;
 };
 
 struct wined3d_rasterizer_state_desc
-- 
2.25.1




More information about the wine-devel mailing list