From 4aea5432ad3d6d7ee7770b166ade51dcd0835704 Mon Sep 17 00:00:00 2001
From: Johannes Specht <jojos_band@gmx.net>
Date: Mon, 4 Sep 2017 02:56:57 +0200
Subject: [PATCH] d3d11: Implement ClearUnorderedAccessViewFloat for deferred
 contexts.

---
 dlls/d3d11/device.c | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index c1a3ab2..5753855 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -91,6 +91,7 @@ enum deferred_cmd
     DEFERRED_CLEARRENDERTARGETVIEW,     /* clear_rtv_info */
     DEFERRED_CLEARDEPTHSTENCILVIEW,     /* clear_depth_info */
     DEFERRED_CLEARUNORDEREDACCESSVIEWUINT,  /* clear_unordered_access_view_uint */
+    DEFERRED_CLEARUNORDEREDACCESSVIEWFLOAT, /* clear_unordered_access_view_float */
 
     DEFERRED_BEGIN,                     /* async_info */
     DEFERRED_END,                       /* async_info */
@@ -305,6 +306,11 @@ struct deferred_call
         } clear_unordered_access_view_uint;
         struct
         {
+            ID3D11UnorderedAccessView *unordered_access_view;
+            float values[4];
+        } clear_unordered_access_view_float;
+        struct
+        {
             ID3D11Asynchronous *asynchronous;
         } async_info;
     };
@@ -656,6 +662,12 @@ static void free_deferred_calls(struct list *commands)
                     ID3D11UnorderedAccessView_Release(call->clear_unordered_access_view_uint.unordered_access_view);
                 break;
             }
+            case DEFERRED_CLEARUNORDEREDACCESSVIEWFLOAT:
+            {
+                if (call->clear_unordered_access_view_float.unordered_access_view)
+                    ID3D11UnorderedAccessView_Release(call->clear_unordered_access_view_float.unordered_access_view);
+                break;
+            }
             case DEFERRED_BEGIN:
             case DEFERRED_END:
             {
@@ -1018,6 +1030,13 @@ static void exec_deferred_calls(ID3D11DeviceContext1 *iface, struct list *comman
                         call->clear_unordered_access_view_uint.values);
                 break;
             }
+            case DEFERRED_CLEARUNORDEREDACCESSVIEWFLOAT:
+            {
+                ID3D11DeviceContext1_ClearUnorderedAccessViewFloat(iface,
+                        call->clear_unordered_access_view_float.unordered_access_view,
+                        call->clear_unordered_access_view_float.values);
+                break;
+            }
             case DEFERRED_BEGIN:
             {
                 ID3D11DeviceContext1_Begin(iface, call->async_info.asynchronous);
@@ -4882,8 +4901,21 @@ static void STDMETHODCALLTYPE d3d11_deferred_context_ClearUnorderedAccessViewUin
 static void STDMETHODCALLTYPE d3d11_deferred_context_ClearUnorderedAccessViewFloat(ID3D11DeviceContext *iface,
         ID3D11UnorderedAccessView *unordered_access_view, const float values[4])
 {
-    FIXME("iface %p, unordered_access_view %p, values %s stub!\n",
+    struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
+    struct deferred_call *call;
+    int i;
+
+    TRACE("iface %p, unordered_access_view %p, values %s.\n",
             iface, unordered_access_view, debug_float4(values));
+
+    if (!(call = add_deferred_call(context, 0)))
+        return;
+
+    call->cmd = DEFERRED_CLEARUNORDEREDACCESSVIEWFLOAT;
+    if (unordered_access_view) ID3D11UnorderedAccessView_AddRef(unordered_access_view);
+    call->clear_unordered_access_view_float.unordered_access_view = unordered_access_view;
+    for (i = 0; i < 4; i++)
+        call->clear_unordered_access_view_float.values[i] = values[i];
 }
 
 static void STDMETHODCALLTYPE d3d11_deferred_context_ClearDepthStencilView(ID3D11DeviceContext *iface,
-- 
1.9.1

