Commit Graph

10574 Commits

Author SHA1 Message Date
Andrey Gusev b006a4c5ac wined3d: Add WINED3DFMT_R11G11B10_FLOAT vertex format.
Used by Dark Souls: Remastered.

Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-17 18:33:57 +01:00
Henri Verbeet 44cb2ba942 wined3d: Release the allocator lock on error in wined3d_allocator_chunk_vk_map().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-17 17:57:04 +01:00
Conor McCarthy d61c9998d9 wined3d: Do not bind buffers in state_cb() if the shader is not set.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52020
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-15 18:55:25 +01:00
Zebediah Figura f69d4a865f wined3d: Trace CS packet pointers.
This makes it easier to "unwind" through the CS thread when debugging.

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-12-09 21:23:24 +01:00
Jan Sikorski 87b5d91412 Revert "wined3d: Acquire references to shaders in deferred contexts.".
This reverts commit 908fb50728.

Moved to wined3d_cs_packet_{in/de}cref_objects().

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-12-09 21:23:18 +01:00
Jan Sikorski 5d450c0a4b wined3d: Acquire shader references for command lists by inspecting CS packets.
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-12-09 21:23:14 +01:00
Jan Sikorski 9340ed6067 Revert "wined3d: Acquire references to samplers in deferred contexts.".
This reverts commit 0056ebf91e.

Sampler references in deferred contexts are now managed by inspecting CS
packets.

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-12-09 21:23:11 +01:00
Jan Sikorski ffa37997be wined3d: Acquire sampler references for command lists by inspecting CS packets.
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-12-09 21:23:05 +01:00
Henri Verbeet 2802328cf6 wined3d: Move the command list reference counting functions to the end of cs.c.
These are part of the public API, so there's not need for them to be at
the start of the file.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 21:23:00 +01:00
Jan Sikorski e418b1f59d wined3d: Use wined3d_next_cs_packet() in wined3d_cs_exec_execute_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-12-09 21:22:50 +01:00
Jan Sikorski 6ebbc4a882 wined3d: Introduce a helper function to extract a packet from a command stream.
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-12-09 21:22:47 +01:00
Zebediah Figura 0cd8c95e67 wined3d: Use wined3d_context_copy_bo_address() in wined3d_buffer_gl_upload_ranges().
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-12-09 21:22:18 +01:00
Henri Verbeet 0eb686f20d wined3d: Pass a wined3d_device_gl pointer to wined3d_device_delete_opengl_contexts_cs().
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-12-09 21:22:15 +01:00
Henri Verbeet 194b47b4fd wined3d: Use the access flags used to create the bo for persistent maps in wined3d_bo_gl_map().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 18:43:51 +01:00
Henri Verbeet c22970af57 wined3d: Pass a wined3d_device_gl pointer to wined3d_device_create_primary_opengl_context_cs().
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-12-09 17:14:59 +01:00
Jan Sikorski 996728315a wined3d: Decrement reference count and take the lock atomically for cached objects.
Samplers, blend states, rasterizer states and depth stencil states can
be retrieved from the cache in struct d3d_device even after the
reference count reaches zero, causing memory corruption.

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-12-09 17:14:59 +01:00
Jacek Caban 9596e7f2a4 win32u: Use user driver for wine_get_vulkan_driver.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 09:57:56 +01:00
Henri Verbeet 537e20e041 wined3d: Map OpenGL adapter BOs persistently on 64-bit architectures.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-02 09:50:59 +01:00
Alexandre Julliard 8d6c33c3bf include: Remove wine/port.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Alexandre Julliard 143bd63b27 include: Remove some no longer used Unicode functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Henri Verbeet c590681e71 wined3d: Respect the BO memory offset in wined3d_context_gl_map_bo_address().
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-12-01 18:13:54 +01:00
Henri Verbeet 45fc3cbf12 wined3d: Do not pass an offset and size to wined3d_bo_gl_map().
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-12-01 18:13:54 +01:00
Henri Verbeet 793ac83d5b wined3d: Always map the whole OpenGL buffer.
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-12-01 18:13:54 +01:00
Henri Verbeet 4ff480b2a2 wined3d: Don't return the BO address offset if glMapBuffer() fails.
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-12-01 18:13:54 +01:00
Zebediah Figura 669360152e wined3d: Always set GL_PIXEL_UNPACK_BUFFER binding in glsl_blitter_upload_palette().
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-12-01 18:13:54 +01:00
Zebediah Figura 21481acaf3 wined3d: Always set GL_PIXEL_UNPACK_BUFFER binding in wined3d_texture_gl_allocate_mutable_storage().
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-12-01 18:13:54 +01:00
Zebediah Figura d3d9785483 wined3d: Always set GL_PIXEL_PACK_BUFFER binding in texture2d_read_from_framebuffer().
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-30 22:07:21 +01:00
Zebediah Figura f4cbd110d9 wined3d: Always set GL_PIXEL_PACK_BUFFER binding before downloading texture data.
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-30 22:07:21 +01:00
Jan Sikorski d2ceed3904 wined3d: Always set GL_PIXEL_UNPACK_BUFFER binding before calling wined3d_texture_gl_upload_bo().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52116
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-29 23:25:46 +01:00
Henri Verbeet 052dbb427d wined3d: Do not add the BO address offset when calling glFlushMappedBufferRange().
Fixes: c2f0ae50b4
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-24 15:33:29 +01:00
Henri Verbeet 0e501c00c4 wined3d: Respect the BO buffer offset in wined3d_context_gl_copy_bo_address().
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-24 15:33:27 +01:00
Zebediah Figura d4c3bf9d79 wined3d: Respect the BO buffer offset in wined3d_buffer_gl_download_ranges().
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-23 13:41:50 +01:00
Henri Verbeet 2961640bcb wined3d: Respect the BO buffer offset in wined3d_buffer_gl_upload_ranges().
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-23 13:41:48 +01:00
Henri Verbeet 7816809395 wined3d: Respect the BO buffer offset in wined3d_unordered_access_view_gl_clear().
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-23 13:41:44 +01:00
Henri Verbeet 0b9002de96 wined3d: Respect the BO buffer offset in create_buffer_texture().
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-23 13:41:40 +01:00
Zebediah Figura d7ba208569 wined3d: Allow OpenGL pixel pack buffer objects to be suballocated from a larger buffer.
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-23 13:41:29 +01:00
Zebediah Figura f059a25af1 wined3d: Respect the BO address offset when flipping the framebuffer in software.
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-23 13:41:26 +01:00
Zebediah Figura 2e67ea199c wined3d: Allow OpenGL indirect draw buffer objects to be suballocated from a larger buffer.
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-22 22:20:50 +01:00
Zebediah Figura 3220ea2431 wined3d: Allow OpenGL indirect dispatch buffer objects to be suballocated from a larger buffer.
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-22 22:20:50 +01:00
Zebediah Figura 9c9b576820 wined3d: Allow OpenGL pixel unpack buffer objects to be suballocated from a larger buffer.
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-22 22:20:50 +01:00
Zebediah Figura 0b9a475324 wined3d: Respect the BO address offset when uploading data from the CPU in wined3d_texture_gl_download_data_slow_path().
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-22 22:20:50 +01:00
Zebediah Figura 5c13b060ca wined3d: Move the "buffer_offset" field to struct wined3d_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-11-22 22:20:50 +01:00
Matteo Bruni 884b7c50cf wined3d: Declare gl_Position as invariant.
All D3D versions seem to basically guarantee invariance for the vertex
position at the very least. In practice, desktop GL implementations
also do the same.
That's not necessarily the case for tile based renderers, where the
cost of providing invariance might be non negligible. We want this
behavior though, so let's ask for it explicitly.

Based on a patch by Stefan Dösinger.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-22 22:20:50 +01:00
Andrey Gusev 4f3d189f53 wined3d: Add WINED3DFMT_R16_FLOAT vertex format.
Fixes rendering glitches in Batman: Arkham Knight.

Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 18:31:38 +01:00
Henri Verbeet ba5f90b29a wined3d: Allow OpenGL atomic counter buffer objects to be suballocated from a larger buffer.
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-19 18:31:38 +01:00
Henri Verbeet 8f0c9e490b wined3d: Allow OpenGL uniform buffer objects to be suballocated from a larger buffer.
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-19 18:31:38 +01:00
Zebediah Figura 3057929d54 wined3d: Allow OpenGL transform feedback buffer objects to be suballocated from a larger buffer.
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-19 18:31:38 +01:00
Henri Verbeet 6c6fcff96e wined3d: Allow OpenGL index buffer objects to be suballocated from a larger 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-11-19 18:31:38 +01:00
Henri Verbeet a9584bf521 wined3d: Allow OpenGL vertex buffer objects to be suballocated from a larger 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-11-19 18:31:38 +01:00
Zebediah Figura 6f0d15e0e3 wined3d: Add a helper to calculate the vertex attribute address for a stream element.
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-19 18:31:38 +01:00