Module: Mesa
Branch: staging/23.3
Commit: 85a215801cf8dc87587614fed7c49a846a923071
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=85a215801cf8dc87587614fed7c49a846a923071

Author: Sil Vilerino <[email protected]>
Date:   Tue Nov 21 22:06:08 2023 -0500

d3d12: d3d12_create_fence_win32 - Fix double refcount bump

Reviewed-by: Jesse Natalie <[email protected]>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
(cherry picked from commit d0103648410f75c1dae48283759d884e9fbf1190)

---

 .pick_status.json                          | 2 +-
 src/gallium/drivers/d3d12/d3d12_screen.cpp | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index ce9fcb9970d..e5bb7c2000c 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -2514,7 +2514,7 @@
         "description": "d3d12: d3d12_create_fence_win32 - Fix double refcount 
bump",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null,
         "notes": null
diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp 
b/src/gallium/drivers/d3d12/d3d12_screen.cpp
index 192d4d96e18..ee74cf2b064 100644
--- a/src/gallium/drivers/d3d12/d3d12_screen.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp
@@ -1189,10 +1189,9 @@ d3d12_get_node_mask(struct pipe_screen *pscreen)
 static void
 d3d12_create_fence_win32(struct pipe_screen *pscreen, struct pipe_fence_handle 
**pfence, void *handle, const void *name, enum pipe_fd_type type)
 {
-   d3d12_fence_reference((struct d3d12_fence **)pfence,
-                         type == PIPE_FD_TYPE_TIMELINE_SEMAPHORE ?
-                           d3d12_open_fence(d3d12_screen(pscreen), handle, 
name) :
-                           nullptr);
+   d3d12_fence_reference((struct d3d12_fence **)pfence, nullptr);
+   if(type == PIPE_FD_TYPE_TIMELINE_SEMAPHORE)
+      *pfence = (struct pipe_fence_handle*) 
d3d12_open_fence(d3d12_screen(pscreen), handle, name);
 }
 
 static void

Reply via email to