32bfc8d017
vkd3d-shader/hlsl: Add a helper for unary arithmetic operations.
...
The helper doesn't do much, but it is useful to mark operations as
arithmetic as opposed to other categories (like bitwise and boolean),
which have a different treatment.
It also saves an explicit variable to most callers, which can directly
pass the argument node instead of creating an array.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com >
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com >
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com >
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com >
Signed-off-by: Alexandre Julliard <julliard@winehq.org >
2021-11-01 20:51:24 +01:00
ed7d2b5316
vkd3d-shader/hlsl: Add helpers for binary arithmetic operations.
...
This commit moves the logic for casting operands to a common type
out of add_expr, so that different helpers can use different logics
(corresponding to the different typing rules used by e.g. arithmetic,
comparison or bitwise operations).
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com >
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com >
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com >
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com >
Signed-off-by: Alexandre Julliard <julliard@winehq.org >
2021-11-01 20:51:15 +01:00
fc053b1c08
vkd3d-shader/hlsl: Allow more implicit conversions between matrices and vectors.
...
HLSL seems to treat matrices 1xN or Nx1 as vectors when looking for
implicit conversions.
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 >
2021-11-01 20:50:27 +01:00
ce9a86975f
vkd3d-shader/hlsl: Return the shape of the left operand when appropriate.
...
The assumption about the size of matrices is not correct: it is
legitimate to compose a matrix 2x2 with a vector of length 4, in which
case it appears that the result has the shape of the first (leftmost)
operand. Even for matrices 1xN or Nx1, the result is not always a
vector: in general it has the shape of the first operand again.
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 >
2021-11-01 20:50:23 +01:00
9196f28822
vkd3d-shader/hlsl: Simplify common shape computation.
...
When t1 is a vector type, it's already supposed to have dimx == max_dim_1
and dimy == 1, and the same for t2.
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 >
2021-11-01 20:50:20 +01:00
e9edb2161e
vkd3d-shader/hlsl: Move the common shape computation to expr_common_shape.
...
Function expr_common_shape can be used for boolean operators,
for which a common shape must be determined even if the base type
of the result is always bool.
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 >
2021-11-01 20:50:17 +01:00
ced3b9a31c
vkd3d-shader/hlsl: Introduce a helper for getting numeric types.
...
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 >
2021-11-01 20:50:14 +01:00
53a7ba4a3a
vkd3d: Enable EXT_shader_stencil_export if available.
...
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-10-18 18:37:01 +02:00
4a2fbe54c0
vkd3d-shader/spirv: Implement support for stencil export.
...
Based on a vkd3d-proton patch 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 >
2021-10-18 18:37:00 +02:00
b8ab71e4dc
tests: Add a test for exporting SV_StencilRef from a pixel shader.
...
Based on a vkd3d-proton patch 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 >
2021-10-18 18:36:58 +02:00
fed21a1245
vkd3d: Implement output merger logic ops.
...
Using vk_logic_op_from_d3d12() from a vkd3d-proton patch 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 >
2021-10-18 18:36:56 +02:00
90d564f798
tests: Add tests for output merger logic ops.
...
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-10-18 18:36:55 +02:00
566eeb0465
vkd3d: Take the mip-level into account for the 3D UAV slice check in vkd3d_create_texture_uav().
...
Based on a vkd3d-proton patch 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 >
2021-10-18 18:36:53 +02:00
c8d94c036d
vkd3d: Do not emit a FIXME for UINT_MAX Texture3D.WSize in vkd3d_create_texture_uav().
...
Specifying UINT_MAX here is equivalent to specifying the remaining layers for
the mip-level.
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-10-18 18:36:51 +02:00
3948056256
vkd3d: Pass descriptor offset info to vkd3d-shader for graphics pipelines.
...
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-10-15 22:38:15 +02:00
1edbd3d698
vkd3d: Pass descriptor offset info to vkd3d-shader for compute pipelines.
...
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-10-15 22:38:15 +02:00
6a88c57f5d
vkd3d: Introduce a helper function to chain vkd3d structures.
...
Analogous to vk_prepend_struct().
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-10-15 22:38:15 +02:00
e328d0b178
vkd3d-shader/spirv: Implement support for descriptor array offsets.
...
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-10-15 22:38:15 +02:00
ea1b01b1f8
vkd3d-shader/spirv: Implement texel offset support for sample_c instructions.
...
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-10-15 22:38:15 +02:00
ebc82a622c
tests: Add tests for sample_c texel offsets.
...
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-10-15 22:38:15 +02:00
a86a681912
vkd3d: Reject 0 sample count textures in d3d12_resource_validate_desc().
...
Buffers with 0 sample counts were already rejected here.
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-10-15 22:38:15 +02:00
a36dfef004
tests: Add a test for 0 sample count resources to test_create_committed_resource().
...
Windows returns E_INVALIDARG at least on AMD and Intel.
Psychonauts 2 attempts to create resources with this argument.
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-10-15 22:38:15 +02:00
2bf4539c0d
tests: Add tests for d3d12_command_list_IASetVertexBuffers() calls with NULL views.
...
Part of 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 >
2021-10-15 22:38:15 +02:00
f172647d5e
vkd3d: Ignore d3d12_command_list_IASetVertexBuffers() calls with NULL views.
...
Part of 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 >
2021-10-15 22:38:15 +02:00
e7e46be371
vkd3d-shader/hlsl: Write SM4 texture declarations.
...
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com >
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com >
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com >
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com >
Signed-off-by: Alexandre Julliard <julliard@winehq.org >
2021-10-15 10:14:05 +02:00