Commit Graph

2123 Commits

Author SHA1 Message Date
Zebediah Figura
ae4ff17b18 vkd3d-shader/hlsl: Write SM4 sampler declarations.
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-10 21:39:12 +01:00
Zebediah Figura
eca2d90a6e vkd3d-shader/hlsl: Handle samplers in write_sm1_uniform().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-10 21:39:09 +01:00
Philip Rebohle
45ccf85ae6 vkd3d-shader/spirv: Ignore break instructions outside active blocks.
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-11-08 22:39:55 +01:00
Philip Rebohle
4e398459b1 vkd3d-shader/spirv: Omit the "endloop" branch to the loop start if the loop block was previously ended.
Avoiding generation of invalid SPIR-V.

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-11-08 22:39:51 +01:00
Giovanni Mascellani
581d71310f vkd3d-shader/hlsl: Fix a typo in an error message.
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-08 11:44:55 +01:00
Giovanni Mascellani
427dbf4062 vkd3d-shader/hlsl: Align conditionals and loops in the IR dump.
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-08 11:44:52 +01:00
Giovanni Mascellani
10593ad653 vkd3d-shader/hlsl: Write SM4 conditionals.
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-08 11:44:48 +01:00
Giovanni Mascellani
09dfe62368 vkd3d-shader/hlsl: Write SM4 loops.
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-08 11:44:44 +01:00
Giovanni Mascellani
ac6164f3d9 vkd3d-shader/hlsl: Introduce a helper to write SM4 code blocks.
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-08 11:44:40 +01:00
Zebediah Figura
d76d777876 vkd3d-shader/hlsl: Parse the Sample() method.
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-08 11:44:30 +01:00
Zebediah Figura
4dfe66b1f1 vkd3d-shader/hlsl: Lex the SamplerState keyword.
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-08 11:44:27 +01:00
Zebediah Figura
00d5f4e761 vkd3d-shader/hlsl: Write SM4 image load instructions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-11-08 11:44:11 +01:00
Zebediah Figura
9d5dce2dc1 vkd3d-shader/hlsl: Define a symbolic constant to represent the D3D_SIF_TEXTURE_COMPONENTS shift.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-11-08 11:43:58 +01:00
Zebediah Figura
c2057c6849 vkd3d-shader/hlsl: Don't explicitly mark the return variable as read in compute_liveness().
The return variable was already added to the extern_vars list and marked as an
output semantic by the append_output_var_copy() call above, so the preceding
loop will take care of setting the last_read field.

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>
2021-11-01 20:51:54 +01:00
Zebediah Figura
182707f168 vkd3d-shader/hlsl: Factor out an hlsl_block structure.
This doesn't hold anything other than a list, nor do I have any immediate plans
for it to hold anything other than a list, but I'm adding it for some degree of
clarity. Passing around untyped list pointers is not my favourite hobby.

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-11-01 20:51:50 +01:00
Zebediah Figura
8485a7c450 vkd3d-shader/hlsl: Store the function body directly in the hlsl_ir_function_decl structure.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-01 20:51:47 +01:00
Zebediah Figura
423213fb05 vkd3d-shader/hlsl: Generate synthetic temps for object uniforms as well.
These can be assigned to when compatibility mode is used.

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: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-01 20:51:42 +01:00
Zebediah Figura
5e3b8b70fc vkd3d-shader/hlsl: Use last_read for resource loads.
This fixes DCE.

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>
2021-11-01 20:51:38 +01:00
Giovanni Mascellani
ed0223e629 vkd3d-shader/hlsl: Add a helper for comparison operations.
The only difference from arithmetic operations is that the result
has always base type 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:51:31 +01:00
Giovanni Mascellani
6658da8861 vkd3d-shader/hlsl: Do not cast types in add_expr.
Determining cast types and return type is now delegated to higher level
helpers, which are differentiated according to the operation category.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
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: Alexandre Julliard <julliard@winehq.org>
2021-11-01 20:51:27 +01:00
Giovanni Mascellani
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
Giovanni Mascellani
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
Giovanni Mascellani
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
Giovanni Mascellani
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
Giovanni Mascellani
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
Giovanni Mascellani
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
Giovanni Mascellani
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
Conor McCarthy
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
Conor McCarthy
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
Conor McCarthy
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
Conor McCarthy
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
Conor McCarthy
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
Conor McCarthy
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
Conor McCarthy
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
Conor McCarthy
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
Conor McCarthy
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
Philip Rebohle
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
Conor McCarthy
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
Conor McCarthy
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
Zebediah Figura
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
Zebediah Figura
4678f2f156 vkd3d-shader/hlsl: Write bound resources into the RDEF table.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 10:14:03 +02:00
Zebediah Figura
c27def4276 vkd3d-shader/hlsl: Sort extern objects by type and resource index for SM4.
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:00 +02:00
Zebediah Figura
899c2f25e2 vkd3d-shader/hlsl: Allocate textures for SM4.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-10-15 10:13:58 +02:00
Conor McCarthy
832e740248 vkd3d: Reject overflowing descriptor ranges.
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-13 22:38:06 +02:00
Conor McCarthy
8239064826 vkd3d: Reject empty descriptor ranges.
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-13 22:38:06 +02:00
Henri Verbeet
8577747879 vkd3d: Normalise layer counts in d3d12_desc_create_srv().
I'm not aware of any issue caused by not normalising SRV layer counts, but
this makes it consistent with the other view types.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:38:04 +02:00
Conor McCarthy
3f6f615e50 vkd3d: Normalise layer counts in d3d12_dsv_desc_create_dsv().
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-12 18:38:01 +02:00
Conor McCarthy
4c07252da6 vkd3d: Normalise layer counts in d3d12_rtv_desc_create_rtv().
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-12 18:37:58 +02:00
Conor McCarthy
bec4f0a85e vkd3d: Normalise layer counts in vkd3d_create_texture_uav().
Passing UINT_MAX as layer count to Direct3D behaves similar to passing
VK_REMAINING_ARRAY_LAYERS to Vulkan. Since these have the same value,
everything usually works out even without normalisation. However, there are
some exceptions; for example, we calculate workgroup counts for UAV clears
from layer counts using vkd3d_compute_workgroup_count(), which doesn't handle
UINT_MAX. Normalising layer counts during view creation avoids having to
handle this issue in the rest of the code.

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-12 18:37:56 +02:00
Conor McCarthy
85def272ae vkd3d-shader/spirv: Correctly handle bit shifts greater than 31 bits.
This is undefined behaviour in SPIR-V, but well-defined in Direct3D, so we
should explicitly 'and' the shift amount with 31.

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-12 18:37:53 +02:00
Robin Kertels
21725c5c08 vkd3d: Ignore D3D12_SO_NO_RASTERIZED_STREAM when stream output is disabled.
Fixes the black screen problem in Diablo 2: Resurrected.

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-11 21:25:28 +02:00
Conor McCarthy
821bb0c5cf vkd3d-shader/spirv: Add non-uniform decorations.
Based in part on vkd3d-proton patches by Philip Rebohle and 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-11 21:25:22 +02:00
Zebediah Figura
cd2df526e1 vkd3d-shader/hlsl: Parse the Load() method.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 16:56:33 +02:00
Zebediah Figura
aafe776401 vkd3d-shader/hlsl: Handle texture types in hlsl_type_to_string().
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-08 16:56:30 +02:00
Zebediah Figura
a56c294abe vkd3d-shader/hlsl: Parse explicitly typed texture types.
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 16:56:28 +02:00
Zebediah Figura
a318f36e59 vkd3d-shader/hlsl: Lex the Texture* keywords.
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: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 16:56:26 +02:00
Zebediah Figura
fcb03a9947 vkd3d-shader/hlsl: Parse texture types.
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-08 16:56:23 +02:00
Conor McCarthy
104626cc1d vkd3d: Create and write descriptor sets for root signature unbounded ranges.
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-06 20:28:44 +02:00
Conor McCarthy
d3090699c5 vkd3d: Reject descriptor tables containing register collisions.
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-06 20:28:41 +02:00
Conor McCarthy
c5fdd2f404 vkd3d: Reject OFFSET_APPEND after unbounded ranges in d3d12_root_signature_info_count_descriptors().
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-06 20:28:38 +02:00
Henri Verbeet
b5a7abbfa6 vkd3d-shader/sm1: Add support for vkd3d_shader_scan().
Nominally, at least. Not all of the early shader models explicitly
declare resources and samplers, so those may currently get missed for
those.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 18:35:46 +02:00
Henri Verbeet
f7662f9878 vkd3d-shader/sm1: Introduce a parser for the legacy D3D byte-code format.
This is largely derived from the parser in Wine/wined3d, as of wine-6.18.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 18:35:44 +02:00
Henri Verbeet
28316b2694 vkd3d-shader: Introduce struct vkd3d_shader_parser_ops.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 18:35:42 +02:00
Henri Verbeet
f5c6f2ea0e vkd3d-shader: Introduce vkd3d_shader_parser_error().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 18:35:40 +02:00
Henri Verbeet
a0c2e52b4b vkd3d-shader/sm4: Set an error state when shader_sm4_error() is called.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 18:35:38 +02:00
Henri Verbeet
8543a1741e vkd3d-shader/sm4: Use the parser location in shader_sm4_error().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 18:35:36 +02:00
Zebediah Figura
12acfd9724 vkd3d-shader/hlsl: Get rid of hlsl_type_is_void().
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>
2021-10-05 21:09:12 +02:00
Zebediah Figura
ded7b381e5 vkd3d-shader/hlsl: SM4 immediate constants do not have a register index.
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-05 21:09:07 +02:00
Henri Verbeet
18e838a1cc vkd3d-shader/sm4: Maintain the parser location in the vkd3d_shader_parser structure.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 15:34:21 +02:00
Henri Verbeet
aca39afd73 vkd3d-shader/sm4: Store the message context pointer in the vkd3d_shader_parser structure.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 15:34:20 +02:00
Henri Verbeet
6be802ac1f vkd3d-shader/sm4: Get rid of the redundant "shader_version" field in the vkd3d_shader_sm4_parser structure.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 15:34:18 +02:00
Henri Verbeet
3023d6ba46 vkd3d-shader/sm4: Rename the vkd3d_sm4_data structure to vkd3d_shader_sm4_parser.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 15:34:16 +02:00
Henri Verbeet
88c8d11805 vkd3d-shader/sm4: Store a vkd3d_shader_parser structure in the vkd3d_sm4_data structure.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 15:34:14 +02:00
Matteo Bruni
49eba71844 vkd3d-shader: Allocate memory for a string buffer at init time.
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-10-01 19:32:52 +02:00
Matteo Bruni
c3f8531477 vkd3d-shader: Don't resize the buffer when there is enough free space.
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-10-01 19:32:46 +02:00
Zebediah Figura
a1f938e8e4 vkd3d-shader/hlsl: Pass the original name string to hlsl_new_type().
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 19:32:39 +02:00
Zebediah Figura
ec8d8e6f73 vkd3d-shader/hlsl: Cache matrix types.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 19:32:37 +02:00
Zebediah Figura
b8502ed51c vkd3d-shader/hlsl: Use cached vector types in more places.
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-01 19:32:35 +02:00
Zebediah Figura
98cfd7b09f vkd3d-shader/hlsl: Avoid hardcoding the size of the operands array.
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 19:32:32 +02:00
Giovanni Mascellani
897ba6a3c7 vkd3d-shader/hlsl: Specify the destination register in struct sm4_instruction as an array.
Some instructions (e.g. umul) have multiple destination registers.

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: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-01 19:32:29 +02:00
Zebediah Figura
efab7c82a5 vkd3d-shader/hlsl: Parse state blocks in variable definitions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-10-01 19:32:26 +02:00
Conor McCarthy
04bb6c395f vkd3d-shader/sm4: Skip second-order extended operands.
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-09-28 20:17:35 +02:00
Conor McCarthy
9e40fe5768 vkd3d-shader/sm4: Parse the "non-uniform" modifier.
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-09-28 20:17:34 +02:00
Conor McCarthy
a422e37953 vkd3d-shader/sm4: Parse register precision modifiers.
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-09-28 20:17:32 +02:00
Conor McCarthy
cddd978be6 vkd3d-shader/sm4: Parse register modifiers separately from the extended operand type.
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-09-28 20:17:30 +02:00
Giovanni Mascellani
859f80930d vkd3d-shader/hlsl: Fix type comparison for column-major matrices.
Previously hlsl_types_are_equal considered two matrices of different
type if one of those had an explicit column-major modifier while the
other didn't have any (in which case the matrix is still considered
column-major by default).

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 20:14:03 +02:00
Giovanni Mascellani
d6d6971fc9 vkd3d-shader/hlsl: Fix a few memory leaks.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-28 20:14:00 +02:00
Giovanni Mascellani
1502740d5b vkd3d-shader/hlsl: Fix a memory leak.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
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-09-28 20:13:58 +02:00
Zebediah Figura
58c80574d8 vkd3d-shader/hlsl: Factor out a variable_decl rule.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-09-27 20:41:48 +02:00
Zebediah Figura
19b21ed005 vkd3d-shader/hlsl: Get rid of append_unop().
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 20:41:46 +02:00
Zebediah Figura
8930bb734f vkd3d-shader/hlsl: Get rid of the unary_op rule.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-09-27 20:41:44 +02:00
Zebediah Figura
9a627494a3 vkd3d-shader/hlsl: Factor out add_unary_expr().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 20:41:42 +02:00
Zebediah Figura
14e9a1ba1c vkd3d-shader/hlsl: Don't dereference a NULL offset_node in hlsl_offset_from_deref().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 20:41:39 +02:00
Zebediah Figura
6765c1dfb4 vkd3d-shader/hlsl: Separate an add_constructor() helper.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-23 20:24:59 +02:00
Giovanni Mascellani
62b25bc52b vkd3d-shader/hlsl: Respect the deref offset for uniforms in sm4_register_from_deref().
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-09-23 20:24:53 +02:00
Zebediah Figura
6f85aad54b vkd3d-shader/hlsl: Do not try to dereference the else_instrs list pointer if there is no else block.
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>
2021-09-23 20:22:51 +02:00
Zebediah Figura
2ebfa91062 vkd3d-shader/hlsl: Introduce an allocation helper for vkd3d_realloc() as well.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-09-23 20:22:48 +02:00
Zebediah Figura
b4e301b2d8 vkd3d-shader/hlsl: Store constant values as an array of unions.
This allows us to more easily manipulate individual elements in a type-agnostic
way. For example, it allows easier implementation of constant swizzle folding.

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-09-23 20:22:44 +02:00
Zebediah Figura
e2b57f6d2b vkd3d-shader/hlsl: Write SM4 exponent instructions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 20:53:33 +02:00
Zebediah Figura
960a473c6d vkd3d-shader/hlsl: Write SM4 logarithm instructions.
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>
2021-09-20 20:53:31 +02:00
Zebediah Figura
2461ad601b vkd3d-shader/hlsl: Parse the pow() intrinsic.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-09-20 20:53:17 +02:00
Zebediah Figura
96fd5f74f9 vkd3d-shader/hlsl: Write SM4 absolute value instructions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 20:53:08 +02:00
Zebediah Figura
c5e50ae658 vkd3d-shader/hlsl: Parse the abs() intrinsic.
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>
2021-09-20 20:53:01 +02:00
Zebediah Figura
75a1a24d63 vkd3d-shader: Factor out a vkd3d_shader_trace_text() helper and use it in vkd3d_spirv_dump() (Valgrind).
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-09-17 22:56:31 +02:00
Zebediah Figura
155812b124 vkd3d-shader/hlsl: Write SM4 saturate instructions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-09-17 22:56:31 +02:00
Zebediah Figura
f0955c164a vkd3d-shader/hlsl: Parse the saturate() intrinsic.
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-09-17 22:56:27 +02:00
Zebediah Figura
4ecdd280ac vkd3d-shader/hlsl: Write SM4 min instructions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 22:05:13 +02:00
Zebediah Figura
ccaa7d2c2b vkd3d-shader/hlsl: Write SM1 min instructions.
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: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 22:05:07 +02:00
Zebediah Figura
c0a7e3e40a vkd3d-shader/hlsl: Write SM4 max 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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 22:05:05 +02:00
Zebediah Figura
b46900bb82 vkd3d-shader/hlsl: Write SM1 max instructions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-09-17 22:05:02 +02:00
Conor McCarthy
eadf0ba88e vkd3d: Do not attempt to enable primitive restart for non-strip topology.
Prevents a validation failure if a d3d12 strip cut value is supplied.
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>
2021-09-17 22:04:27 +02:00
Giovanni Mascellani
46282caf0f vkd3d-shader/hlsl: Write constant buffer offsets in bytes.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 18:35:07 +02:00
Giovanni Mascellani
eeeb9a5c2a vkd3d-shader/hlsl: Write dimension for constant buffer registers.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 18:35:05 +02:00
Henri Verbeet
77b5125fda vkd3d-shader/glsl: Explicitly initialise "buffer" in vkd3d_glsl_generator_create().
So that we don't get in trouble if vkd3d_string_buffer_init() were to
start doing more than zeroing fields.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 18:34:46 +02:00
Zebediah Figura
c53a641b26 vkd3d-shader/hlsl: Write SM4 casts to uint.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@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>
2021-09-15 18:34:08 +02:00
Zebediah Figura
b08e8a9177 vkd3d-shader/hlsl: Write SM4 casts to int.
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 18:34:06 +02:00
Zebediah Figura
9d54153271 vkd3d-shader/hlsl: Write SM4 casts to float.
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-09-15 18:34:03 +02:00
Henri Verbeet
4509f089e5 vkd3d-shader: Introduce shader_sm4_reset().
This allows us to drop the "ptr" argument to various functions.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 17:52:16 +02:00
Henri Verbeet
26009069dd vkd3d-shader: Pass a vkd3d_shader_parser structure to shader_sm4_is_end().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 17:52:14 +02:00
Henri Verbeet
bb482332bf vkd3d-shader: Pass a vkd3d_shader_parser structure to shader_sm4_read_instruction().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 17:52:13 +02:00
Henri Verbeet
12190ee3a9 vkd3d-shader: Pass a vkd3d_shader_parser structure to shader_sm4_read_header().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 17:52:11 +02:00
Henri Verbeet
661570254d vkd3d-shader: Pass a vkd3d_shader_parser structure to shader_sm4_free().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 17:52:09 +02:00
Conor McCarthy
471b8e2206 vkd3d: Handle D3D_PRIMITIVE_TOPOLOGY_UNDEFINED.
Bundles need to set an undefined topology to match D3D12 behaviour.

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-09-08 17:41:10 +02:00
Conor McCarthy
2ed344a5f0 vkd3d: Change to void the return type for ID3D12GraphicsCommandList::ClearState().
ClearState() does not return a value.

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-09-08 17:41:07 +02:00
Conor McCarthy
eb3d8c911c vkd3d-shader: Free the capabilities array on spirv builder destruction.
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-09-08 17:41:01 +02:00
Zebediah Figura
d035f3c2ff vkd3d-shader/hlsl: Parse the clamp() intrinsic.
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 17:40:55 +02:00
Zebediah Figura
99674ab60f vkd3d-shader/hlsl: Parse the max() intrinsic.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 17:40:52 +02:00
Zebediah Figura
f86e4d6b92 vkd3d-shader/hlsl: Use get_overloaded_func() only to find exact matches.
The parameters are specified as a list of hlsl_ir_var structures, but
add_call() is given an array of hlsl_ir_node pointers. Even if the former were
changed to use an array instead, it's not worth trying to reuse the same
function for both cases.

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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 17:40:49 +02:00
Zebediah Figura
32ba154eb2 vkd3d-shader/hlsl: Parse function calls.
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-08 17:40:46 +02:00
Henri Verbeet
1c8b0d1062 vkd3d-shader: Pass a vkd3d_shader_parser structure to vkd3d_dxbc_binary_to_text().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 22:02:06 +02:00
Henri Verbeet
a129206e7e vkd3d-shader: Pass a vkd3d_shader_parser structure to vkd3d_shader_trace().
Mostly to avoid passing around void pointers.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 22:02:03 +02:00
Henri Verbeet
a8b062000e vkd3d-shader: Only use scan_dxbc() for scanning dxbc-tpf source.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 22:01:59 +02:00
Henri Verbeet
7fa0de03b9 vkd3d-shader/hlsl: Set the source name in hlsl_ctx_init().
Without this, HLSL compiler messages were missing the source name. For
example, when attempting to compile gears.hlsl from the "gears" demo
with vkd3d-compiler:

    ":33:17: E5000: syntax error, unexpected NEW_IDENTIFIER"

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 22:01:55 +02:00
Henri Verbeet
cfc09a210a vkd3d-shader: Dump HLSL shaders with a ".hlsl" suffix.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 22:01:52 +02:00
Zebediah Figura
28092bb200 vkd3d-shader/hlsl: Use the modifiers location when validating modifiers on casts.
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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 17:10:46 +02:00
Zebediah Figura
6ee423a21b vkd3d-shader/hlsl: Merge the "type" and "base_type" rules.
It's certainly invalid to declare a vector of non-scalars, but it doesn't need
to result in a syntax error. Indeed native d3dcompiler does not emit a syntax
error in this case.

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-09-01 17:10:43 +02:00
Zebediah Figura
7e353ce62b vkd3d-shader/hlsl: Write SM4 negation instructions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 17:10:40 +02:00
Zebediah Figura
2fb1643ee0 vkd3d-shader/hlsl: Write SM4 division 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: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 17:10:37 +02:00
Zebediah Figura
0d6fb615d2 vkd3d-shader/hlsl: Write SM4 multiplication instructions.
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: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 17:10:33 +02:00
Henri Verbeet
5f4fc9cb06 vkd3d-shader: Use vkd3d_swizzle_get_component() in shader_dump_src_param().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-31 10:56:18 +02:00
Giovanni Mascellani
8b6db3d366 vkd3d-shader/hlsl: Cleanup HLSL context during error path.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
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-08-31 10:56:05 +02:00
Giovanni Mascellani
910aa4df01 vkd3d-shader/hlsl: Do not swallow compilation errors.
There are cases where compilation fails, but no error message is
recorded. They usually correspond to unimplemented features, but
still failure should be forwarded to the caller, otherwise it will
manifest itself later in more confusing ways (like not being able
to find a function even though it was apparently correctly compiled).

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-31 10:56:03 +02:00
Giovanni Mascellani
b5251b3350 vkd3d-shader/hlsl: Simplify expr_common_base_type.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
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-08-27 21:20:47 +02:00
Giovanni Mascellani
176b12f9e4 vkd3d-shader/hlsl: Return int as common type between bool and bool.
So does the native d3dcompiler, following the spirit of integer promotion
in C.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
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-08-27 21:20:43 +02:00
Giovanni Mascellani
5a55e8e8d5 vkd3d-shader/hlsl: Move the base type equality case in expr_common_base_type.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-27 21:20:39 +02:00
Zebediah Figura
fbcdc7a9d4 vkd3d-shader/hlsl: Write SM4 addition instructions.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-27 21:20:18 +02:00
Zebediah Figura
ebfb8be1c6 vkd3d-shader/hlsl: Write SM4 constant instructions.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-27 21:20:15 +02:00
Zebediah Figura
32fd18837b vkd3d-shader/hlsl: Write SM4 swizzle instructions.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-27 21:20:13 +02:00
Zebediah Figura
51b8c46b9d vkd3d-shader/hlsl: Write SM4 load instructions.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-27 21:20:11 +02:00
Zebediah Figura
4232231dd3 vkd3d-shader/hlsl: Write SM4 store 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>
2021-08-27 21:20:08 +02:00
Zebediah Figura
ac88631755 vkd3d-shader/hlsl: Avoid crashing when emitting a dereference with non-constant offset.
Some places assert() that the register is allocated.

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: Alexandre Julliard <julliard@winehq.org>
2021-08-27 21:20:04 +02:00
Zebediah Figura
864e816de8 vkd3d-shader/hlsl: Write the SHDR token count.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-23 20:51:10 +02:00
Zebediah Figura
636ec27381 vkd3d-shader/hlsl: Write the SM4 ret instruction.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-23 20:51:08 +02:00
Zebediah Figura
40ec063a26 vkd3d-shader/hlsl: Write the SM4 dcl_temps instruction.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-23 20:51:01 +02:00
Zebediah Figura
62456beeda vkd3d-shader/hlsl: Write SM4 semantic declarations.
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-08-23 20:50:59 +02:00
Zebediah Figura
5da4949f7c vkd3d-shader/hlsl: Write SM4 constant buffer 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: Alexandre Julliard <julliard@winehq.org>
2021-08-23 20:50:57 +02:00
Zebediah Figura
464dae2c46 vkd3d-shader/hlsl: Write SM4 signatures.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-23 20:50:55 +02:00
Zebediah Figura
62c60776b9 vkd3d-shader/hlsl: Use vkd3d_make_u32() in more places.
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-08-23 20:50:51 +02:00
Conor McCarthy
04a08088ec vkd3d: Calculate shader visibility once per root signature table.
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-08-19 20:43:30 +02:00
Conor McCarthy
2021734a7b vkd3d: Pass a struct d3d12_root_descriptor_table_range to vk_write_descriptor_set_from_d3d12_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>
2021-08-19 20:43:27 +02:00
Conor McCarthy
c7fc5ff819 vkd3d: Store descriptor sets in an array.
Unbounded ranges can result in multiple descriptor sets being
used.

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-08-19 20:43:24 +02:00
Atharva Nimbalkar
0d03a52f6c vkd3d-shader/glsl: Implement VKD3DSIH_DCL_OUTPUT.
Signed-off-by: Atharva Nimbalkar <atharvakn@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 20:42:56 +02:00
Atharva Nimbalkar
d71483d0e5 vkd3d-shader/glsl: Implement VKD3DSIH_RET.
Signed-off-by: Atharva Nimbalkar <atharvakn@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 20:42:53 +02:00
Atharva Nimbalkar
ebe3bf0c00 vkd3d-shader/glsl: Implement VKD3D_DCL_OUTPUT_SIV.
Signed-off-by: Atharva Nimbalkar <atharvakn@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 20:42:50 +02:00
Atharva Nimbalkar
f5b95a08a5 vkd3d-shader/glsl: Implement VKD3DSIH_DCL_INPUT.
Signed-off-by: Atharva Nimbalkar <atharvakn@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 20:42:47 +02:00
Atharva Nimbalkar
72435b8ac7 vkd3d-shader/glsl: Implement vkd3d_glsl_generator_generate().
Signed-off-by: Atharva Nimbalkar <atharvakn@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 20:42:44 +02:00
Zebediah Figura
d509e7ead5 vkd3d-shader/hlsl: Write SM5 RDEF extensions.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-19 20:42:17 +02:00
Zebediah Figura
b89b02d21f vkd3d-shader/hlsl: Write data types into the RDEF section.
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-08-19 20:42:14 +02:00
Zebediah Figura
f402f7042e vkd3d-shader/hlsl: Write the RDEF section.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-19 20:42:10 +02:00
Zebediah Figura
ed49461309 vkd3d-shader/hlsl: Write an empty SHDR section.
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-08-19 20:42:08 +02:00
Zebediah Figura
96d523722d vkd3d-shader/hlsl: Write empty SM4 shaders.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-19 20:42:04 +02:00
Zebediah Figura
2db8cbc9a7 vkd3d-shader/hlsl: Free all instruction lists in reverse order (Valgrind).
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-08-19 20:41:48 +02:00
Atharva Nimbalkar
0376a8b4ee vkd3d-shader: Implement VKD3D_SHADER_TARGET_GLSL.
Signed-off-by: Atharva Nimbalkar <atharvakn@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 23:16:52 +02:00
Zebediah Figura
3dfe0e1710 vkd3d: Do not append a newline to messages passed to d3d12_device_mark_as_removed().
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-08-16 18:41:06 +02:00
Zebediah Figura
c08a9cff7f vkd3d-shader/hlsl: Make some FIXME messages into proper compiler errors.
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-08-16 18:40:59 +02:00
Zebediah Figura
65a13c8290 vkd3d-shader/hlsl: Remove a couple of redundant default switch cases.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-16 18:40:53 +02:00
Zebediah Figura
3cc6b565ce vkd3d-shader/hlsl: Split array copies.
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: Alexandre Julliard <julliard@winehq.org>
2021-08-16 18:40:51 +02:00
Zebediah Figura
7960f9e373 vkd3d-shader/hlsl: Rename hlsl_ir_expr_op members.
For the sake of simplicity and clarity, especially in the interest of allowing
us to have expressions with larger numbers of terms.

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: Alexandre Julliard <julliard@winehq.org>
2021-08-16 18:40:48 +02:00
Zebediah Figura
b65789e74a vkd3d-shader/hlsl: Use a designated initializer in debug_expr_op().
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: Alexandre Julliard <julliard@winehq.org>
2021-08-16 18:40:44 +02:00
Conor McCarthy
f3c19dfedb vkd3d-shader: Implement UTOD instruction.
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-08-12 17:44:36 +02:00
Conor McCarthy
3623a99cf6 vkd3d-shader: Implement ITOD instruction.
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-08-12 17:44:32 +02:00
Conor McCarthy
88c08df03b vkd3d-shader: Implement DTOU instruction.
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-08-12 17:44:30 +02:00
Conor McCarthy
c61b573d9c vkd3d-shader: Implement DTOI instruction.
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-08-12 17:44:26 +02:00
Conor McCarthy
580747b224 vkd3d-shader: Implement DTOF instruction.
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-08-12 17:44:22 +02:00
Conor McCarthy
821389d274 vkd3d-shader: Implement FTOD instruction.
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-08-12 17:44:18 +02:00
Zebediah Figura
6e3bdb17dc vkd3d-shader: Lower SUB to NEG + ADD at parse time.
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-08-11 20:58:27 +02:00
Zebediah Figura
ed7cdb3940 vkd3d-shader: Introduce vkd3d_make_u{16, 32}() helpers.
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-08-11 20:58:24 +02:00
Zebediah Figura
2dedc937a0 vkd3d-shader: Move SM1 code generation to a separate file.
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-08-11 20:58:02 +02:00
Zebediah Figura
ae3df158d8 vkd3d-shader: Fold negations of constant integers.
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-08-11 20:58:00 +02:00
Zebediah Figura
b956efcaa4 vkd3d-shader: Fold constant casts from int to float.
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-08-11 20:57:57 +02:00
Conor McCarthy
00752b8fa6 vkd3d-shader: Implement DMOVC instruction.
Based in part on a vkd3d-proton patch by Joshua Ashton.

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-08-11 11:38:29 +02:00
Conor McCarthy
c3363faba2 vkd3d-shader: Implement DRCP instruction.
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-08-11 11:38:27 +02:00
Conor McCarthy
6656a92c45 vkd3d-shader: Implement DDIV instruction.
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-08-11 11:38:25 +02:00
Conor McCarthy
25b559ba25 vkd3d-shader: Implement DMUL instruction.
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-08-11 11:38:23 +02:00
Conor McCarthy
a08d99e026 vkd3d: Initialise static samplers before the root descriptor tables.
If static samplers are done after an unbounded range has been initialised,
the samplers will occupy their own descriptor set layout instead of sharing
one with the bounded ranges.

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-08-10 15:32:00 +02:00
Conor McCarthy
d746105835 vkd3d: Iterate over the root signature's range table instead of the D3D12 table.
Future sorting of ranges will greatly simplify processing of
unbounded ranges and handling of descriptor aliasing.

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-08-10 15:31:58 +02:00
Conor McCarthy
e8ac03973d vkd3d: Introduce a helper function to append descriptor set layouts to the layout array.
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-08-10 15:31:56 +02:00
Conor McCarthy
242261bc52 vkd3d-shader: Implement DFMA instruction.
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-08-09 21:43:40 +02:00
Conor McCarthy
74a9a0b167 vkd3d-shader: Implement DMIN instruction.
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-08-09 21:43:36 +02:00
Conor McCarthy
44a3ebb77c vkd3d-shader: Implement DMAX instruction.
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-08-09 21:43:34 +02:00