Henri Verbeet
acc0f49aae
wined3d: Introduce separate read and write resource map flags.
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-19 13:43:52 +01:00
Henri Verbeet
f08342f573
wined3d: Use the global memory allocation helpers.
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-14 09:06:58 +01:00
Henri Verbeet
96432c4cc2
d3d9: Use wined3d_buffer_create() in d3d9_device_prepare_vertex_buffer().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-09 09:19:12 +01:00
Henri Verbeet
f181da61a0
d3d9: Use wined3d_buffer_create() in d3d9_device_prepare_index_buffer().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-07 10:05:42 +01:00
Henri Verbeet
c0f92bd318
wined3d: Implement wined3d_buffer_create_ib() on top of wined3d_buffer_create().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-05 10:00:07 +01:00
Henri Verbeet
1377e7a608
wined3d: Implement wined3d_buffer_create_vb() on top of wined3d_buffer_create().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-05 10:00:07 +01:00
Henri Verbeet
8623bd3b6b
wined3d: Replace the CPU access flags in struct wined3d_buffer_desc with resource access flags.
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-05 10:00:07 +01:00
Henri Verbeet
9275b06cc0
wined3d: Replace the pool in struct wined3d_resource_desc with resource access flags.
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-02 18:36:45 +01:00
Henri Verbeet
c26c9badc4
wined3d: Use the resource access flags in buffer_init().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-30 20:42:06 +01:00
Henri Verbeet
2abf1dd323
wined3d: Get rid of WINED3D_POOL_SCRATCH.
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-29 20:29:00 +01:00
Józef Kucia
2100e140ca
wined3d: Change wined3d_buffer_copy() return type to void.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-08 20:02:03 +09:00
Józef Kucia
5d71c48cb3
wined3d: Factor out context_copy_bo_address() function.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-08 20:01:49 +09:00
Józef Kucia
c45b908abc
wined3d: Introduce wined3d fence objects.
...
Use fences for the APPLESYNC codepath, and implement event queries
on top of fences.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-10 20:51:10 +02:00
Józef Kucia
11c902ebc7
wined3d: Clean up buffer_sync_apple().
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-10 20:51:10 +02:00
Józef Kucia
0edb71a35f
wined3d: Avoid creating event queries manually.
...
Fixes a regression introduced by commit
be20ddc38b
.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-07-10 20:51:10 +02:00
Józef Kucia
be20ddc38b
wined3d: Introduce query operation to destroy queries.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-30 11:03:55 +02:00
Henri Verbeet
cb77e188d1
wined3d: Validate constant buffer alignment.
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-25 20:47:45 +02:00
Henri Verbeet
3311ea9859
wined3d: Use context_map_bo_address() in wined3d_buffer_copy().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-21 10:53:55 +02:00
Henri Verbeet
49da36a501
wined3d: Introduce a context function to bind a buffer object.
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-20 09:51:32 +02:00
Józef Kucia
3ca84a348e
wined3d: Pause transform feedback between draw calls.
...
In order to avoid recording vertices generated by other operations, e.g.
blits.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 22:06:31 +02:00
Józef Kucia
2e3300fa59
wined3d: Enable transform feedback if geometry shader with stream output is active.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 22:06:31 +02:00
Henri Verbeet
cd4223b0a4
wined3d: Only drop WINED3D_MAP_DISCARD right before mapping the buffer object in wined3d_buffer_map().
...
Dropping WINED3D_MAP_DISCARD too early means we go through the system memory
path unnecessarily. Worse, as mentioned in an earlier comment, Darkstar One
depends on the entire buffer being uploaded in case of WINED3D_MAP_DISCARD
maps, and dropping the flag too early prevents that as well. This fixes a
regression introduced by commit 15d53761a5
.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-30 09:01:47 +02:00
Józef Kucia
96570c5216
wined3d: Bind transform feedback buffers.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-29 20:54:05 +02:00
Józef Kucia
3d459c6152
wined3d: Handle stream output buffer bind flag.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-23 15:14:26 +01:00
Józef Kucia
36b9bc946b
wined3d: Introduce helper function to reserve memory for arrays.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-28 20:40:02 +01:00
Józef Kucia
d867c6aa1e
wined3d: Pass structure byte stride to wined3d_buffer_create().
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-23 20:13:07 +01:00
Henri Verbeet
4aea36184d
wined3d: Validate WINED3D_LOCATION_BUFFER on WINED3D_MAP_DISCARD buffer maps.
...
Usually when doing a WINED3D_MAP_DISCARD map on a buffer with a buffer object
WINED3D_LOCATION_BUFFER will already be current. However, if the previous map
on that buffer loaded WINED3D_LOCATION_SYSMEM, that's not necessarily true.
This also brings the code further in line with the corresponding code for
textures.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-23 08:55:47 +01:00
Sebastian Lackner
d3c11f507f
wined3d: Remove duplicate assignment of NULL to map_ptr in wined3d_buffer_map.
...
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-17 20:54:05 +01:00
Henri Verbeet
9e2498f25e
wined3d: Send sampler GL initialisation through the command stream.
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-16 08:30:56 +01:00
Henri Verbeet
2641c5c28f
wined3d: Pass a texture and sub-resource index to context_acquire().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-15 16:16:20 +01:00
Józef Kucia
2249527922
wined3d: Use more suitable bind target for SRV/UAV buffers.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-08 17:00:09 +01:00
Henri Verbeet
6fd212818d
wined3d: Do not preload the buffer in wined3d_buffer_unmap().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-31 19:48:44 +01:00
Henri Verbeet
413ccc82db
wined3d: Load WINED3D_LOCATION_BUFFER if needed in wined3d_buffer_map().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-31 19:48:44 +01:00
Henri Verbeet
e2dbbec1af
wined3d: Implement wined3d_buffer_upload_data() on top of wined3d_buffer_upload_ranges().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-31 19:48:44 +01:00
Henri Verbeet
160ad4570e
wined3d: Support WINED3D_LOCATION_BUFFER in wined3d_buffer_load_location().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-31 19:48:44 +01:00
Henri Verbeet
15d53761a5
wined3d: Do not pin system memory in wined3d_buffer_load_location().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-31 19:48:44 +01:00
Henri Verbeet
ca6014b19a
wined3d: Return success in wined3d_buffer_load_location() when the location is already current.
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 21:38:52 +01:00
Henri Verbeet
afb2aa2512
wined3d: Try to avoid stalling on dynamic buffer maps.
...
Particularly for applications that use dynamic buffers without
WINED3D_MAP_DISCARD/WINED3D_MAP_NOOVERWRITE.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 21:38:52 +01:00
Henri Verbeet
efdb898bef
wined3d: Evict system memory for dynamic buffers on the first WINED3D_MAP_DISCARD map.
...
Mostly to avoid making things worse for applications that map dynamic buffers
without WINED3D_MAP_DISCARD/WINED3D_MAP_NOOVERWRITE.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 21:38:52 +01:00
Henri Verbeet
a5f7aff3bb
wined3d: Do not upload data in buffer_create_buffer_object().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 21:38:52 +01:00
Henri Verbeet
451e137c1b
wined3d: Do not evict the system memory copy in buffer_create_buffer_object().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-30 21:38:52 +01:00
Henri Verbeet
b924ccb699
wined3d: Check buffer->map_ptr to determine if the buffer object is mapped.
...
Instead of trying to replicate the wined3d_buffer_map() logic in
wined3d_buffer_unmap().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-27 16:31:45 +01:00
Henri Verbeet
7a18b2473f
wined3d: Introduce wined3d_buffer_evict_sysmem().
...
For consistency with the texture code.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-27 16:31:45 +01:00
Henri Verbeet
6a70c55615
wined3d: Rename WINED3D_BUFFER_DOUBLEBUFFER to WINED3D_BUFFER_PIN_SYSMEM.
...
For consistency with the texture code.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-27 16:31:45 +01:00
Henri Verbeet
a11e301566
wined3d: Introduce wined3d_buffer_upload_ranges().
...
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-27 16:31:45 +01:00
Henri Verbeet
602a23a60a
wined3d: Just use glBufferSubData() in buffer_direct_upload().
...
It might seem like a good idea to try to use glMapBufferRange() in
buffer_direct_upload(), but it really isn't. The interesting cases for
glMapBufferRange() are GL_MAP_INVALIDATE_BUFFER_BIT or
GL_MAP_UNSYNCHRONIZED_BIT, but the only way for those to be set here
would be for the buffer to be mapped with WINED3D_MAP_DISCARD or
WINED3D_MAP_NOOVERWRITE before the buffer object was created. In that
case the GPU is obviously not using the buffer object, so
glMapBufferRange() doesn't help. On the other hand, if the buffer is
currently in use by the application and neither WINED3D_MAP_DISCARD nor
WINED3D_MAP_NOOVERWRITE is set, glMapBufferRange() would need to wait
for the GPU to finish using the buffer object, while glBufferSubData()
may decide not to.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-27 16:31:44 +01:00
Józef Kucia
8187817830
wined3d: Add initial support for shader buffer views.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-26 16:57:48 +01:00
Francois Gouget
551705d65f
wined3d: Make some functions static.
...
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-01-09 20:49:10 +01:00
Józef Kucia
a02fd72965
wined3d: Use depth/stencil formats for typeless resources only when WINED3DUSAGE_DEPTHSTENCIL is set.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-12 19:40:33 +01:00
Józef Kucia
e2733ed7fb
wined3d: Return location from wined3d_buffer_get_memory().
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-07 16:59:46 +01:00