Alexandre Julliard
129b0be7ac
vkd3d: Add inline wrappers for the pthread synchronization functions.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2022-02-04 16:46:03 +01:00
Zebediah Figura
13a1ba4263
vkd3d-shader/preproc: Allow capital U and L after integer constants as well.
...
Technically we shouldn't allow "uu" or "ll" either, but we also don't really
handle preprocessor parsing errors the way we should.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-02 21:06:21 +01:00
Nikolay Sivov
4e36c1825d
vkd3d-shader/hlsl: Implement floor().
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-02 21:06:19 +01:00
Nikolay Sivov
11d962ddbf
vkd3d-shader/hlsl: Cast saturate() input to float.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-02 21:06:17 +01:00
Nikolay Sivov
22d8b0a033
vkd3d-shader/hlsl: Cast round() input to float.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-02 21:06:15 +01:00
Alexandre Julliard
7710f5deaf
vkd3d-shader: Use LONG type with InterlockedIncrement.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2022-01-31 15:58:15 +01:00
Alexandre Julliard
2d1fb5ef33
vkd3d-shader: Fix some DWORD/unsigned int pointer mismatches.
...
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2022-01-31 15:58:12 +01:00
Alexandre Julliard
e21928f6ee
vkd3d-shader: Consistently use uint32_t for pointers to shader data.
...
Mixing uint32_t and DWORD pointers causes warnings on Windows.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2022-01-31 15:58:08 +01:00
Alexandre Julliard
beafa0914e
vkd3d: Replace atomic_add_fetch() by InterlockedAdd().
...
By analogy with InterlockedIncrement. It avoids the need for a
configure check on Windows platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
2022-01-28 17:48:32 +01:00
Francisco Casas
6de080088a
vkd3d-shader/hlsl: Implement texture gather methods.
...
Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-26 18:36:26 +01:00
Francisco Casas
96c2a3e586
vkd3d-shader/hlsl: Add aoffimmi modifiers on Sample sm4 instructions.
...
Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-26 18:36:22 +01:00
Francisco Casas
2570967aab
vkd3d-shader/hlsl: Add texel_offset field to hlsl_ir_resource_load.
...
Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-26 18:36:20 +01:00
Francisco Casas
591cec956e
vkd3d-shader/hlsl: Add support for sm4 instruction modifiers.
...
Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-26 18:36:18 +01:00
Zebediah Figura
5c330e7a78
vkd3d-shader/hlsl: Introduce a sm4_dst_from_node() helper.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-26 18:36:16 +01:00
Zebediah Figura
505751d2e4
vkd3d-shader/hlsl: Introduce a sm4_src_from_deref() helper.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-26 18:36:14 +01:00
Zebediah Figura
c2803da1f0
vkd3d-shader/hlsl: Introduce a sm4_src_from_node() helper.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-26 18:36:12 +01:00
Zebediah Figura
8cb3ec4640
vkd3d-shader/hlsl: Propagate copies for resource load instructions.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-24 18:23:45 +01:00
Zebediah Figura
4529fbe57f
vkd3d-shader/hlsl: Do not calculate a buffer offset for object variables.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-24 18:23:42 +01:00
Zebediah Figura
387ec06b6f
vkd3d-shader/hlsl: Pass copy_propagation_state and hlsl_deref pointers to copy_propagation_compute_replacement().
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-24 18:23:40 +01:00
Zebediah Figura
62bcdcda76
vkd3d-shader/hlsl: Handle objects in copy propagation.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-24 18:23:36 +01:00
Matteo Bruni
5e14b843ea
vkd3d-shader/hlsl: Use hlsl_alloc() in hlsl_new_texture_type().
...
Spotted by Giovanni Mascellani.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-24 18:23:34 +01:00
Conor McCarthy
5d627d6c64
vkd3d: Handle plane slice for texture views.
...
vk_image_aspect_flags_from_d3d12_plane_slice() is based on a
vkd3d-proton implementation by Philip Rebohle.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-21 18:35:51 +01:00
Conor McCarthy
8e30a7750e
vkd3d: Use the resource's stored format in d3d12_command_list_CopyTextureRegion().
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-21 18:35:48 +01:00
Giovanni Mascellani
2d619f3d52
vkd3d-shader/hlsl: Remove HLSL_OP2_GREATER and HLSL_OP2_LEQUAL.
...
They are replaced with HLSL_OP2_LESS and HLSL_OP2_GEQUAL after swapping
the parameters.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 22:47:13 +01:00
Giovanni Mascellani
9182e73e64
vkd3d-shader/hlsl: Write SM4 greater-or-equal instructions.
...
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 22:47:13 +01:00
Giovanni Mascellani
2f3b1e8f7d
vkd3d-shader/hlsl: Write SM4 less-than instructions.
...
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 22:47:13 +01:00
Giovanni Mascellani
1db9dab156
vkd3d-shader/hlsl: Write SM4 inequality instructions.
...
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 22:47:13 +01:00
Giovanni Mascellani
f23415f4b5
vkd3d-shader/hlsl: Write SM4 equality instructions.
...
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 22:47:13 +01:00
Zebediah Figura
8ced37058d
vkd3d-shader/hlsl: Fold constant casts from int to uint.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 22:47:13 +01:00
Zebediah Figura
833bfa8812
vkd3d-shader/hlsl: Use list_empty() instead of comparing list_count() against zero.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 22:47:13 +01:00
Conor McCarthy
c965b7b213
vkd3d: Handle NULL event handles in ID3D12Fence::SetEventOnCompletion().
...
The D3D12 documentation states: "If hEvent is a null handle, then
this API will not return until the specified fence value(s) have
been reached."
Based on a vkd3d-proton patch by Hans-Kristian Arntzen.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 22:47:09 +01:00
Conor McCarthy
de87352f77
vkd3d: Use the resource's stored format in init_default_texture_view_desc().
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 17:33:53 +01:00
Conor McCarthy
beb9151e5d
vkd3d: Use the resource's stored format in d3d12_command_list_ResolveSubresource().
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 17:33:50 +01:00
Conor McCarthy
68b70585a7
vkd3d: Use the resource's stored format in d3d12_command_list_CopyResource().
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 17:33:47 +01:00
Conor McCarthy
ecb854c6c1
vkd3d: Add DXGI_FORMAT_UNKNOWN to the array of vkd3d_format objects.
...
This results in a valid format instead of NULL being returned for
buffers and any other case where DXGI_FORMAT_UNKNOWN is specified.
In some cases invalid use of a buffer or DXGI_FORMAT_UNKNOWN will
not result in E_INVALIDARG, and would need to be tested explicitly
if proven to be an issue.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 17:33:42 +01:00
Conor McCarthy
e1f2325aec
vkd3d: Use the resource's stored format in d3d12_resource_ReadFromSubresource().
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 17:33:36 +01:00
Conor McCarthy
4c3ecdf5fd
vkd3d: Use the resource's stored format in d3d12_resource_WriteToSubresource().
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 17:33:34 +01:00
Conor McCarthy
04b1c977ce
vkd3d: Use the resource's stored format in d3d12_resource_validate_box().
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 17:33:31 +01:00
Conor McCarthy
70d87dcf37
vkd3d: Use the resource's stored format in vkd3d_create_image().
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 17:33:28 +01:00
Conor McCarthy
16393e10d5
vkd3d: Use the resource's stored format in d3d12_command_list_ResourceBarrier().
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 17:33:25 +01:00
Conor McCarthy
1f3ec35138
vkd3d: Store the vkd3d format in resource objects.
...
Resource formats are immutable and the format object is static data.
Storing it saves a function call and error check in many locations.
The current implementation for finding a format iterates over the
entire list of formats.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 17:33:22 +01:00
Conor McCarthy
66bc2672a1
vkd3d: Implement ID3D12CommandQueue_GetClockCalibration().
...
Extends vkd3d_instance_create_info with struct vkd3d_host_time_domain_info
to allow host ticks per second to be changed from the default 10000000.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-18 09:22:56 +01:00
Conor McCarthy
440286e9de
vkd3d-shader/spirv: Enable descriptor indexing if runtime arrays are used.
...
SpvCapabilityRuntimeDescriptorArrayEXT requires descriptor indexing and
a validation error will result if it is not enabled.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-18 09:22:51 +01:00
Conor McCarthy
2566b8dd8c
vkd3d: Handle depth/stencil planes in GetCopyableFootprints().
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-13 17:21:08 +01:00
Zebediah Figura
4fdd6f0935
vkd3d-shader: Trace tiled resource opcodes.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-13 17:20:44 +01:00
Zebediah Figura
8f26c99f8b
vkd3d-shader: Use a designated initializer for the shader_opcode_names array.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-13 17:20:41 +01:00
Conor McCarthy
5d2b604b5c
vkd3d: Handle D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE using a Vulkan extension.
...
Used by Cyberpunk 2077.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-10 20:10:11 +01:00
Conor McCarthy
eb1ae29de0
vkd3d-shader/dxbc: Emit a fixme when a DXIL shader chunk is found.
...
Simplifies detection of SM6+ shaders, e.g. Horizon Zero Dawn and
Cyberpunk 2077.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-10 20:10:08 +01:00
Conor McCarthy
758b984c41
vkd3d-shader/spirv: Support UAV counter descriptor arrays.
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-07 16:49:06 +01:00
Conor McCarthy
c04b6b1765
vkd3d: Do not flag a descriptor table as dirty if it is unchanged.
...
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-07 16:49:00 +01:00