wined3d-UAV_Counters: Remove patch.

The parameter checks in d3d11 are not particularly necessary; there is no known application that passes NULL here, and such an application would be easy to detect.

The additional reference to the UAV resource need not be taken, since wined3d_cs_exec_copy_uav_counter() never touches the resource (only the UAV itself).

The offset parameter check is not borne out by native Windows; indeed passing an invalid offset leaves the device in a broken state.
This commit is contained in:
Zebediah Figura 2020-01-30 23:47:23 -06:00
parent 6e474e34fb
commit fa188fd6b0
2 changed files with 0 additions and 85 deletions

View File

@ -327,7 +327,6 @@ patch_enable_all ()
enable_wined3d_Indexed_Vertex_Blending="$1"
enable_wined3d_SWVP_shaders="$1"
enable_wined3d_Silence_FIXMEs="$1"
enable_wined3d_UAV_Counters="$1"
enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM="$1"
enable_wined3d_WINED3D_RS_COLORWRITEENABLE="$1"
enable_wined3d_WINED3D_TEXF_ANISOTROPIC="$1"
@ -1107,9 +1106,6 @@ patch_enable ()
wined3d-Silence_FIXMEs)
enable_wined3d_Silence_FIXMEs="$2"
;;
wined3d-UAV_Counters)
enable_wined3d_UAV_Counters="$2"
;;
wined3d-WINED3DFMT_B8G8R8X8_UNORM)
enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM="$2"
;;
@ -6973,18 +6969,6 @@ if test "$enable_wined3d_Silence_FIXMEs" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-UAV_Counters
# |
# | Modified files:
# | * dlls/d3d11/device.c, dlls/wined3d/cs.c, dlls/wined3d/device.c
# |
if test "$enable_wined3d_UAV_Counters" -eq 1; then
patch_apply wined3d-UAV_Counters/0001-wined3d-Remaining-UAV-counter-changes.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Remaining UAV counter changes.", 1 },';
) >> "$patchlist"
fi
# Patchset wined3d-WINED3DFMT_B8G8R8X8_UNORM
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,69 +0,0 @@
From a1b44c071715bf9393e2e2da72ea987db7a4146e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 9 Aug 2017 06:32:43 +0200
Subject: wined3d: Remaining UAV counter changes.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Based on patches by Michael Müller and Józef Kucia.
---
dlls/d3d11/device.c | 3 +++
dlls/wined3d/cs.c | 2 ++
dlls/wined3d/device.c | 6 ++++++
3 files changed, 11 insertions(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index df754de1..abd7bbcf 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -1075,6 +1075,9 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopyStructureCount(ID3D11D
TRACE("iface %p, dst_buffer %p, dst_offset %u, src_view %p.\n",
iface, dst_buffer, dst_offset, src_view);
+ if (!dst_buffer || !src_view)
+ return;
+
buffer_impl = unsafe_impl_from_ID3D11Buffer(dst_buffer);
uav = unsafe_impl_from_ID3D11UnorderedAccessView(src_view);
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 5ea25e99..1417c07b 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -2468,6 +2468,7 @@ static void wined3d_cs_exec_copy_uav_counter(struct wined3d_cs *cs, const void *
context_release(context);
wined3d_resource_release(&op->buffer->resource);
+ wined3d_resource_release(view->resource);
}
void wined3d_cs_emit_copy_uav_counter(struct wined3d_cs *cs, struct wined3d_buffer *dst_buffer,
@@ -2482,6 +2483,7 @@ void wined3d_cs_emit_copy_uav_counter(struct wined3d_cs *cs, struct wined3d_buff
op->view = uav;
wined3d_resource_acquire(&dst_buffer->resource);
+ wined3d_resource_acquire(uav->resource);
wined3d_cs_submit(cs, WINED3D_CS_QUEUE_DEFAULT);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c90cbdbe..ebe396d7 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4023,6 +4023,12 @@ void CDECL wined3d_device_copy_uav_counter(struct wined3d_device *device,
TRACE("device %p, dst_buffer %p, offset %u, uav %p.\n",
device, dst_buffer, offset, uav);
+ if (offset + sizeof(GLuint) > dst_buffer->resource.size)
+ {
+ WARN("Offset %u too large.\n", offset);
+ return;
+ }
+
wined3d_cs_emit_copy_uav_counter(device->cs, dst_buffer, offset, uav);
}
--
2.19.1