d3d11-Deferred_Context, wined3d-CSMT_Main: Fix data size calculation for block-based formats with unaligned size.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51172
This commit is contained in:
Zebediah Figura 2021-05-24 23:16:59 -05:00
parent 99d312740b
commit 69765f438b
2 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
From 36509e9ab2c9bb0447eaa2d7b046826ec90fb0a5 Mon Sep 17 00:00:00 2001
From a9fd4b162802070ec3115c92f0a0d2fae6523d2e Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Fri, 14 May 2021 15:51:55 -0500
Subject: [PATCH] wined3d: Implement
@ -12,7 +12,7 @@ Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 20b2719fa9d..7be128f2ec4 100644
index 20b2719fa9d..20449024643 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -490,6 +490,7 @@ struct wined3d_cs_update_sub_resource
@ -67,8 +67,8 @@ index 20b2719fa9d..7be128f2ec4 100644
+ const struct wined3d_format *format = resource->format;
+
+ data_size = (box->back - box->front - 1) * slice_pitch
+ + ((box->bottom - box->top) / format->block_height - 1) * row_pitch
+ + ((box->right - box->left) / format->block_width) * format->block_byte_count;
+ + ((box->bottom - box->top - 1) / format->block_height) * row_pitch
+ + ((box->right - box->left + format->block_width - 1) / format->block_width) * format->block_byte_count;
+ }
+
+ op = wined3d_device_context_require_space(context, sizeof(*op) + data_size, WINED3D_CS_QUEUE_DEFAULT);

View File

@ -1,4 +1,4 @@
From 9f87eed99a552da787cd2bdfbc601cb8636a0d9c Mon Sep 17 00:00:00 2001
From 50eb09e2b9b0d8a9f2301353e58af510a098c682 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Sat, 22 May 2021 18:26:41 -0500
Subject: [PATCH] wined3d: Submit the data inline in
@ -14,7 +14,7 @@ Based on a patch by Michael Müller.
2 files changed, 74 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index a17926f6ff0..6aeb2e000e3 100644
index 0186b1b3184..e5c554e04d3 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -2704,6 +2704,38 @@ static void wined3d_cs_update_sub_resource(struct wined3d_device_context *contex
@ -32,8 +32,8 @@ index a17926f6ff0..6aeb2e000e3 100644
+ const struct wined3d_format *format = resource->format;
+
+ data_size = (box->back - box->front - 1) * slice_pitch
+ + ((box->bottom - box->top) / format->block_height - 1) * row_pitch
+ + ((box->right - box->left) / format->block_width) * format->block_byte_count;
+ + ((box->bottom - box->top - 1) / format->block_height) * row_pitch
+ + ((box->right - box->left + format->block_width - 1) / format->block_width) * format->block_byte_count;
+ }
+
+ if (context->ops->check_space(context, sizeof(*op) + data_size, WINED3D_CS_QUEUE_DEFAULT))