Commit Graph

335 Commits

Author SHA1 Message Date
Zebediah Figura 7148f3939a wined3d: Make the "buffer_object" field of struct wined3d_bo_address a wined3d_bo pointer.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-16 17:44:42 +01:00
Jan Sikorski 0056ebf91e wined3d: Acquire references to samplers in deferred contexts.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-15 19:54:17 +01:00
Jan Sikorski 908fb50728 wined3d: Acquire references to shaders in deferred contexts.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-15 19:54:17 +01:00
Jan Sikorski 6057507be4 wined3d: Acquire references to depth stencil states in deferred contexts.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-15 19:54:17 +01:00
Jan Sikorski a313f6bc5c wined3d: Acquire references to rasterizer states in deferred contexts.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-15 19:54:17 +01:00
Jan Sikorski 2228c356e3 wined3d: Acquire references to blend states in deferred contexts.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-15 19:54:17 +01:00
Zebediah Figura b72053868a wined3d: Try to allocate new Vulkan BOs from the client thread for DISCARD maps.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-10 18:56:24 +01:00
Zebediah Figura 1b16a606f7 wined3d: Introduce a wined3d_buffer_update_sub_resource() helper.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:54 +01:00
Zebediah Figura d630aa20bf wined3d: Make the "buffer_object" field of struct wined3d_buffer a wined3d_bo pointer.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-09 22:02:54 +01:00
Jan Sikorski 803274ac14 wined3d: Reduce locking of device context operations.
Only actually take the lock for the immediate context. According to the
d3d11 documentation, operations on device contexts are not thread safe,
and testing on Windows confirms this.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-01 20:46:21 +01:00
Jan Sikorski 90cd8b0764 wined3d: Make reference count decrementing functions thread safe.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 18:32:03 +02:00
Zebediah Figura 9acf66b795 wined3d: Handle NOOVERWRITE maps on persistently mapped Vulkan buffers from the client thread.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 18:30:53 +02:00
Zebediah Figura 3a8a9a678d wined3d: Return the map pitch from the map_upload_bo() callbacks.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-14 09:14:11 +02:00
Zebediah Figura 4b7beecbeb wined3d: Return the map pitch from wined3d_device_context_emit_map().
Partially undoes 61024aa12f.

We may want to be able to return an existing BO from
context->ops->map_upload_bo(), in which case it is structurally awkward to
request a specific memory layout. We may also want to give map_upload_bo() the
freedom to allocate either a new (smaller) BO, or use an existing (larger) one,
for partial uploads.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-14 09:14:07 +02:00
Jan Sikorski 6d2d43bb05 wined3d: Make wined3d_device_context procedures thread safe.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-11 21:33:38 +02:00
Jan Sikorski 89d61c28e4 wined3d: Use a single allocation for command list data.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:35 +02:00
Zebediah Figura 7bc0d3edc4 wined3d: Do not return a struct upload_bo from the map_upload_bo callback.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 20:09:21 +02:00
Zebediah Figura f0cc2ef2bd wined3d: Call the unmap_upload_bo callback in wined3d_device_context_emit_update_sub_resource().
We will need to mark the resource as no longer mapped, from the client's
perspective.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 20:09:21 +02:00
Zebediah Figura a8ff9865b9 wined3d: Rename {prepare, get}_upload_bo() to {map, unmap}_upload_bo().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 20:09:21 +02:00
Zebediah Figura 6ba6d65d91 wined3d: Do not emit an upload for NOOVERWRITE maps on deferred contexts.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 20:09:20 +02:00
Jan Sikorski fbecfaec1b wined3d: Initial implementation of queries for deferred contexts.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 20:09:20 +02:00
Zebediah Figura e06f52eb00 wined3d: Wrap the upload bo address in a new upload_bo structure.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:12 +02:00
Zebediah Figura e906468c64 wined3d: Call prepare_upload_bo in wined3d_device_context_emit_map() only for DISCARD or NOOVERWRITE maps.
We can't do an asynchronous upload with just WINED3D_MAP_WRITE, but we can with
update_sub_resource, and prepare_upload_bo doesn't know which it was called
from.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:12 +02:00
Jan Sikorski 8a7e6cf166 wined3d: Record a state reset on the first command list.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 20:15:10 +02:00
Jan Sikorski bb285f56f9 wined3d: Avoid stalling the pipeline on 3D blits.
Load the source texture to WINED3D_LOCATION_BUFFER, so that the copy
is GPU-side only.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 19:34:23 +02:00
Zebediah Figura e4502cff81 wined3d: Check for failure from wined3d_device_context_require_space() in wined3d_device_context_emit_unmap().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51485
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-27 16:39:55 +02:00
Zebediah Figura 5ce7adaace d3d11: Implement constant buffer offsetting for OpenGL.
Based on a patch by Kimmo Myllyvirta.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45198
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:21:52 +02:00
Zebediah Figura befaf4d612 wined3d: Set an array of rendertarget views as a single CS operation.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:21:47 +02:00
Zebediah Figura 086212ba57 wined3d: Set an arary of stream sources as a single CS operation.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:21:39 +02:00
Zebediah Figura 5d588eaa4f wined3d: Set both the stream source and frequency for a given index as a single CS operation.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:21:27 +02:00
Zebediah Figura 96da563f0d wined3d: Set the entire stream output state as a single CS operation.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:21:13 +02:00
Zebediah Figura 84d6845412 wined3d: Recursively acquire queued command lists in wined3d_cs_acquire_command_list().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:19:05 +02:00
Zebediah Figura 82be8b676c wined3d: Fix some memory leaks when destroying deferred contexts.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 21:12:11 +02:00
Zebediah Figura bc8dcae118 wined3d: Fix some memory leaks when destroying command lists.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 21:12:09 +02:00
Zebediah Figura 3f60840cdc wined3d: Move the uploads array in wined3d_deferred_context_record_command_list().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51416
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 21:12:06 +02:00
Zebediah Figura 393ea20679 wined3d: Set an array of UAVs as a single CS operation.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-07 18:14:38 +02:00
Zebediah Figura 34a9d3e40f wined3d: Set an array of samplers as a single CS operation.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 16:06:14 +02:00
Zebediah Figura 7698b9e25a wined3d: Set an array of shader resource views as a single CS operation.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 16:06:11 +02:00
Zebediah Figura e6bbf6ee91 wined3d: Set an array of constant buffers as a single CS operation.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 16:06:07 +02:00
Zebediah Figura a68cdf4a41 wined3d: Pass a wined3d_cs pointer to wined3d_not_from_cs().
This partially reverts 6a9752bf5e.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 16:06:03 +02:00
Zebediah Figura f2fe987907 wined3d: Factor out most of the execute_command_list callback to a common function.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 16:06:01 +02:00
Zebediah Figura 0c36633a20 wined3d: Print a message when forcing CS serialization.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-02 16:49:09 +02:00
Zebediah Figura 6a9752bf5e wined3d: No longer queue WINED3D_CS_QUEUE_MAP operations through wined3d_device_context_ops.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Zebediah Figura 7186d8bef5 wined3d: Implement NOOVERWRITE maps in wined3d_deferred_context_prepare_upload_bo().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Zebediah Figura 65e31e4508 wined3d: Use context->ops->prepare_upload_bo() in wined3d_device_context_map() if possible.
This has the notable effect of implementing maps on deferred contexts.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Zebediah Figura 75928a6a88 wined3d: Implement wined3d_deferred_context_prepare_upload_bo().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Zebediah Figura cf55fc493c wined3d: Introduce a prepare_upload_bo device context operation and use it to upload sub-resource data.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Zebediah Figura f5a22e4310 wined3d: Pass a wined3d_const_bo_address to wined3d_cs_exec_update_sub_resource().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 15:31:28 +02:00
Zebediah Figura a260928b81 wined3d: Use wined3d_buffer_copy_bo_address() in wined3d_cs_exec_update_sub_resource().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 15:31:26 +02:00
Henri Verbeet 0170bb0e54 wined3d: Only invalidate valid state IDs in wined3d_cs_exec_reset_state().
Not every state ID between 0 and STATE_HIGHEST is valid; for example, there
are holes in the renderstate IDs. While invalidating these works fine,
attempting to subsequently apply them in e.g. context_apply_draw_state() ends
up calling state_undefined() and printing an ERR. This is especially visible
when running the d2d1 tests.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-25 22:48:48 +02:00