Commit Graph

10174 Commits

Author SHA1 Message Date
Henri Verbeet 2ff9a8f08a wined3d: Do not fail swapchain creation in wined3d_swapchain_vk_init() if a Vulkan swapchain could not be created.
While far from ideal, we can still use swapchain_blit_gdi() to get
back-buffers to the screen.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 09:10:18 +01:00
Henri Verbeet 70418f69dd wined3d: Introduce a backup path for swapchain presents using GDI.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 09:10:16 +01:00
Henri Verbeet b8719736c5 wined3d: Recognise the read-only depth/stencil view flags in wined3d_debug_view_desc().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-18 22:39:34 +01:00
Zebediah Figura da9726a16c wined3d: Support WINED3D_RTYPE_BUFFER in wined3d_check_device_format().
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-02-12 16:10:46 +01:00
Henri Verbeet 7ba0cc9085 wined3d: Add some TRACEs to command stream callbacks.
I.e., those used with wined3d_cs_init_object() and
wined3d_cs_destroy_object().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 18:31:23 +01:00
Henri Verbeet b9a440d15d wined3d: Create the backbuffer rendertarget view only after calling adapter_init_3d().
Otherwise we may not be able to acquire a context to create the view. In
practice, this is only an issue for d3d9 and earlier in combination with the
Vulkan backend.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 18:31:20 +01:00
Henri Verbeet fb9ec02e06 wined3d: Construct a separate source box in wined3d_device_copy_resource().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:14:52 +01:00
Henri Verbeet 1039bf036f wined3d: Compare resource sizes in blocks in wined3d_device_copy_resource().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:14:50 +01:00
Henri Verbeet 6aa9eec60f wined3d: Use the format block dimensions to construct the destination box for sub-resource region copies.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:14:47 +01:00
Henri Verbeet 02385a4042 wined3d: Allow resource copies between block-compatible formats.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:14:43 +01:00
Jan Sikorski 6b7f02026c wined3d: Return E_INVALIDARG from vertexdeclaration_init() on validation failure.
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-02-08 20:10:15 +01:00
Jan Sikorski 81dfece45c wined3d: Align vertex attribute offsets to their size, if smaller than 4.
This should not change behaviour for d3d9 and earlier, where all formats
have sizes that are multiples of 4.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43422
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-02-08 20:10:12 +01:00
Andrey Gusev c66e0e5723 wined3d: Add AMD Radeon RX 5500M.
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-02-05 22:53:46 +01:00
Henri Verbeet 08dc5b92e0 wined3d: Invalidate STATE_STENCIL_REF when switching between NULL and non-NULL depth/stencil views.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 22:53:46 +01:00
Jan Sikorski 3655e7d945 wined3d: Added missing states to debug_d3dstate().
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-02-03 21:01:32 +01:00
Jan Sikorski 433aaccc1f wined3d: Check for stencil reference change in vulkan backend.
Make stencil reference value dynamic, so it can be updated separately.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50380
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-02-03 21:01:29 +01:00
Jan Sikorski f3aceef725 wined3d: Store stencil reference value in wined3d_state.
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-02-03 21:01:26 +01:00
Zebediah Figura 387a63237d wined3d: Implement global resource memory barriers.
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-01-29 20:53:32 +01:00
Zhiyi Zhang 98f490bdfc wined3d: Support multiple outputs.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 17:53:54 +01:00
Zebediah Figura 2d6462cdee wined3d: Make adapter_gl_clear_uav() static.
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-01-25 23:31:19 +01:00
Henri Verbeet 53916000f8 wined3d: Trace the available Vulkan extensions.
Like we do for OpenGL.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-25 23:31:03 +01:00
Henri Verbeet 50a90dcb32 wined3d: Implement NULL constant buffer views for the Vulkan backend.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 18:33:32 +01:00
Henri Verbeet ff19c3e6fa wined3d: Require VK_KHR_sampler_mirror_clamp_to_edge for WINED3D_TADDRESS_MIRROR_ONCE.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 18:33:32 +01:00
Henri Verbeet f0dae1d852 wined3d: Correct the argument order of a FIXME in wined3d_texture_vk_download_data().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Henri Verbeet c47b28f5d4 wined3d: Stencil test also uses the depth/stencil buffer.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Henri Verbeet a3f829bbb8 wined3d: Always include any depth/stencil attachment in the Vulkan framebuffer.
Analogous to the GL backend. The alternative would be to potentially
invalidate STATE_FRAMEBUFFER when changing the depth/stencil state object,
which doesn't seem worth it.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Henri Verbeet c75bbc5c22 wined3d: End the current render pass in wined3d_buffer_vk_barrier().
As we do for image barriers.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Henri Verbeet e796da7a5e wined3d: Properly convert Vulkan sample count format information.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Zebediah Figura 6bdf641142 wined3d: Use YieldProcessor().
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-01-21 20:46:10 +01:00
Henri Verbeet 82a9e80063 wined3d: Add some barriers between resource usage on different bind points.
A typical case would be between using a texture as render target and using it
as a shader resource.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 21:44:17 +01:00
Henri Verbeet e2e776462d wined3d: Introduce wined3d_context_vk_reference_resource().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 21:44:17 +01:00
Henri Verbeet 92dacb1d68 wined3d: Get rid of the "UseGLSL" setting.
This was deprecated in Wine 5.0, use the "shader_backend" setting instead.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 21:44:17 +01:00
Henri Verbeet 7a54209d4b wined3d: Implement the "precise" flag in the GLSL shader backend.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 21:44:17 +01:00
Henri Verbeet fc50ea2351 wined3d: Also trace memory types in adapter_vk_init_driver_info().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:37 +01:00
Henri Verbeet 1efa4ec7fa wined3d: Handle UNORM/SNORM as FLOAT in shader_glsl_sprintf_cast().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:37 +01:00
Henri Verbeet 8ef6484deb wined3d: Handle UNORM/SNORM as FLOAT in shader_glsl_append_dst_ext().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:37 +01:00
Henri Verbeet d54576c89b wined3d: Cleanup the staging bo on an error path in wined3d_texture_vk_upload_data().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:37 +01:00
Henri Verbeet 0d2b730f9e wined3d: Get rid of the destination offset in wined3d_texture_vk_upload_data().
The idea was once to use permanent bo's for textures, similar to how texture
PBOs work in the OpenGL backend. In that case we would have needed to copy to
the correct position in the bo, in order not to modify other parts of the bo.
With the current scheme, the destination offset serves no purpose.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:37 +01:00
Henri Verbeet 3cc8147594 wined3d: Use glFinish() for synchronisation when cleaning up a destroyed context in wined3d_context_gl_cleanup().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50485
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-15 10:09:57 +01:00
Zebediah Figura 9cbe273558 wined3d: Use debug_d3dusage() for both usage and usage query flags.
Avoid spurious FIXME messages in wined3d_check_device_format().

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-01-04 17:12:45 +01:00
Henri Verbeet afac4f09c7 wined3d: Do not create Vulkan 2D (array) views for UAVs on 3D resources.
We should simply create 3D views.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50123
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-16 16:22:36 +01:00
Henri Verbeet 619c87bb59 wined3d: Avoid referencing empty command buffers in wined3d_query_event_vk_issue().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-15 22:09:21 +01:00
Henri Verbeet 353e84015b wined3d: Zero-initialise context_vk in wined3d_context_vk_init().
wined3d_context_vk_init() assumes zero-initialised memory, but that's not
necessarily true in case we previously went through an
adapter_vk_init_3d()/adapter_vk_uninit_3d() pair.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-15 22:09:21 +01:00
Rafał Harabień e6c777d26d d3d9: Fix handling of D3DENUM_WHQL_LEVEL.
D3DENUM_NO_WHQL_LEVEL from Direct3D 8 was replaced with D3DENUM_WHQL_LEVEL in
Direct3D 9.

Signed-off-by: Rafał Harabień <rafalh92@outlook.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 16:21:49 +01:00
Henri Verbeet 85152f3a50 wined3d: The Vulkan blitter supports depth blits.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50123
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 16:21:47 +01:00
Henri Verbeet b4e109f2f5 wined3d: Unmap the slab if needed in wined3d_context_vk_destroy_bo().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 16:21:45 +01:00
Henri Verbeet 9992d710e4 wined3d: Unmap the chunk if needed in wined3d_context_vk_destroy_bo().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 16:21:42 +01:00
Henri Verbeet 4e7be88990 wined3d: Only clear "map_ptr" if the memory was unmapped in wined3d_allocator_chunk_vk_unmap().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 16:21:40 +01:00
Henri Verbeet 46c7f66cf3 wined3d: Compare requested memory types in wined3d_bo_slab_vk_compare().
Instead of comparing the requested memory type against what we actually got.
For example, we may have gotten coherent memory without having explicitly
requested it, in which case wined3d_context_vk_create_slab_bo() would fail to
find an existing slab to allocate from.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 16:21:37 +01:00
Henri Verbeet 675adf0163 wined3d: Do not request VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT for unmappable buffers.
In particular, some implementations may not support the combination of
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT and VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
for all buffer types, or at all.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-10 16:26:39 +01:00