wined3d: Align CS packet size to the header size.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2020-03-24 17:35:24 +01:00 committed by Alexandre Julliard
parent ef66c4488f
commit 9c190f8118
1 changed files with 2 additions and 1 deletions

View File

@ -2651,8 +2651,9 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
struct wined3d_cs_packet *packet;
header_size = FIELD_OFFSET(struct wined3d_cs_packet, data[0]);
size = (size + header_size - 1) & ~(header_size - 1);
packet_size = FIELD_OFFSET(struct wined3d_cs_packet, data[size]);
packet_size = (packet_size + header_size - 1) & ~(header_size - 1);
size = packet_size - header_size;
if (packet_size >= WINED3D_CS_QUEUE_SIZE)
{
ERR("Packet size %lu >= queue size %u.\n",