wined3d-CSMT_Main: Pass the right size to wined3d_device_context_require_space().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51172
This commit is contained in:
Zebediah Figura 2021-05-24 11:19:11 -05:00
parent cfe44f6d5d
commit 5bbe3e47a5

View File

@ -1,4 +1,4 @@
From 2a9bf4da900b257f9809e436364dadd094f351d1 Mon Sep 17 00:00:00 2001
From 9f87eed99a552da787cd2bdfbc601cb8636a0d9c 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,10 +14,10 @@ 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 7c116e3f887..368d61952cf 100644
index a17926f6ff0..6aeb2e000e3 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -2734,6 +2734,38 @@ static void wined3d_cs_update_sub_resource(struct wined3d_device_context *contex
@@ -2704,6 +2704,38 @@ static void wined3d_cs_update_sub_resource(struct wined3d_device_context *contex
const void *data, unsigned int row_pitch, unsigned int slice_pitch)
{
struct wined3d_cs_update_sub_resource *op;
@ -38,7 +38,7 @@ index 7c116e3f887..368d61952cf 100644
+
+ if (context->ops->check_space(context, sizeof(*op) + data_size, WINED3D_CS_QUEUE_DEFAULT))
+ {
+ op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
+ op = wined3d_device_context_require_space(context, sizeof(*op) + data_size, WINED3D_CS_QUEUE_DEFAULT);
+ op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
+ op->resource = resource;
+ op->sub_resource_idx = sub_resource_idx;
@ -56,7 +56,7 @@ index 7c116e3f887..368d61952cf 100644
wined3d_resource_wait_idle(resource);
@@ -2749,8 +2781,7 @@ static void wined3d_cs_update_sub_resource(struct wined3d_device_context *contex
@@ -2719,8 +2751,7 @@ static void wined3d_cs_update_sub_resource(struct wined3d_device_context *contex
wined3d_device_context_acquire_resource(context, resource);
wined3d_device_context_submit(context, WINED3D_CS_QUEUE_MAP);
@ -66,7 +66,7 @@ index 7c116e3f887..368d61952cf 100644
wined3d_device_context_finish(context, WINED3D_CS_QUEUE_MAP);
}
@@ -2971,6 +3002,12 @@ static void wined3d_cs_exec_execute_command_list(struct wined3d_cs *cs, const vo
@@ -2940,6 +2971,12 @@ static void wined3d_cs_exec_execute_command_list(struct wined3d_cs *cs, const vo
}
}
@ -79,7 +79,7 @@ index 7c116e3f887..368d61952cf 100644
static void *wined3d_cs_st_require_space(struct wined3d_device_context *context,
size_t size, enum wined3d_cs_queue_id queue_id)
{
@@ -3028,6 +3065,7 @@ static void wined3d_cs_st_finish(struct wined3d_device_context *context, enum wi
@@ -2997,6 +3034,7 @@ static void wined3d_cs_st_finish(struct wined3d_device_context *context, enum wi
static const struct wined3d_device_context_ops wined3d_cs_st_ops =
{
@ -87,7 +87,7 @@ index 7c116e3f887..368d61952cf 100644
wined3d_cs_st_require_space,
wined3d_cs_st_submit,
wined3d_cs_st_finish,
@@ -3070,6 +3108,19 @@ static void wined3d_cs_mt_submit(struct wined3d_device_context *context, enum wi
@@ -3039,6 +3077,19 @@ static void wined3d_cs_mt_submit(struct wined3d_device_context *context, enum wi
wined3d_cs_queue_submit(&cs->queue[queue_id], cs);
}
@ -107,7 +107,7 @@ index 7c116e3f887..368d61952cf 100644
static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size_t size, struct wined3d_cs *cs)
{
size_t queue_size = ARRAY_SIZE(queue->data);
@@ -3132,6 +3183,17 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
@@ -3101,6 +3152,17 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
return packet->data;
}
@ -125,7 +125,7 @@ index 7c116e3f887..368d61952cf 100644
static void *wined3d_cs_mt_require_space(struct wined3d_device_context *context,
size_t size, enum wined3d_cs_queue_id queue_id)
{
@@ -3156,6 +3218,7 @@ static void wined3d_cs_mt_finish(struct wined3d_device_context *context, enum wi
@@ -3125,6 +3187,7 @@ static void wined3d_cs_mt_finish(struct wined3d_device_context *context, enum wi
static const struct wined3d_device_context_ops wined3d_cs_mt_ops =
{
@ -133,7 +133,7 @@ index 7c116e3f887..368d61952cf 100644
wined3d_cs_mt_require_space,
wined3d_cs_mt_submit,
wined3d_cs_mt_finish,
@@ -3391,6 +3454,13 @@ static struct wined3d_deferred_context *wined3d_deferred_context_from_context(st
@@ -3360,6 +3423,13 @@ static struct wined3d_deferred_context *wined3d_deferred_context_from_context(st
return CONTAINING_RECORD(context, struct wined3d_deferred_context, c);
}
@ -147,7 +147,7 @@ index 7c116e3f887..368d61952cf 100644
static void *wined3d_deferred_context_require_space(struct wined3d_device_context *context,
size_t size, enum wined3d_cs_queue_id queue_id)
{
@@ -3608,6 +3678,7 @@ static void wined3d_deferred_context_execute_command_list(struct wined3d_device_
@@ -3577,6 +3647,7 @@ static void wined3d_deferred_context_execute_command_list(struct wined3d_device_
static const struct wined3d_device_context_ops wined3d_deferred_context_ops =
{
@ -156,10 +156,10 @@ index 7c116e3f887..368d61952cf 100644
wined3d_deferred_context_submit,
wined3d_deferred_context_finish,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4f235fb04cd..b1c87f389cd 100644
index e7a3e42d8bb..59cb5fe75cb 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -4695,6 +4695,7 @@ struct wined3d_cs_queue
@@ -4682,6 +4682,7 @@ struct wined3d_cs_queue
struct wined3d_device_context_ops
{