Francisco Casas
edc72fdefc
vkd3d-shader/hlsl: Support semantics for array types.
2023-05-01 22:18:21 +02:00
Francisco Casas
a488889494
vkd3d-shader/hlsl: Don't create semantic vars more than once.
2023-05-01 22:18:20 +02:00
Francisco Casas
b589c2b32d
vkd3d-shader/hlsl: Move get_array_size() and get_array_type() to hlsl.c.
2023-05-01 22:18:19 +02:00
Francisco Casas
61c72a4fd1
vkd3d-shader/hlsl: Avoid invalid input/output copies for non-numeric types.
2023-05-01 22:18:17 +02:00
Nikolay Sivov
7ba373946b
vkd3d-shader/hlsl: Implement D3DCOLORtoUBYTE4() function.
2023-04-28 21:04:13 +02:00
Nikolay Sivov
4b3707aeb4
vkd3d-shader/hlsl: Partially implement trunc().
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-04-28 21:04:11 +02:00
Ethan Lee
138c32ce88
vkd3d-shader/hlsl: Add support for ddx(), ddy() intrinsics.
...
SPIR-V already handled DSX/DSY, so only D3DBC/TPF needed new case blocks.
Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
2023-04-28 21:03:40 +02:00
Nikolay Sivov
af4bb03795
vkd3d-shader/hlsl: Implement SampleBias() method.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-04-26 22:46:55 +02:00
Nikolay Sivov
c166ab9727
vkd3d-shader/hlsl: Add separate helpers to generate object methods.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-04-26 22:46:53 +02:00
Nikolay Sivov
59c63ec584
vkd3d-shader/hlsl: Handle discard statement.
...
Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-04-26 22:46:50 +02:00
Nikolay Sivov
6da7d16d4c
vkd3d-shader/trace: Add separate id for discard.
...
Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
2023-04-26 22:46:49 +02:00
Zebediah Figura
b46df551eb
vkd3d-shader/tpf: Return unsigned int from hlsl_sm4_register_from_semantic().
...
Fix a compile warning:
../vkd3d/libs/vkd3d-shader/hlsl_codegen.c: In function 'allocate_semantic_register':
../vkd3d/libs/vkd3d-shader/hlsl_codegen.c:2947:85: error: passing argument 4 of 'hlsl_sm4_register_from_semantic' from incompatible pointer type [-Werror=incompatible-pointer-types]
2947 | if ((builtin = hlsl_sm4_register_from_semantic(ctx, &var->semantic, output, &type, NULL, &has_idx)))
| ^~~~~
| |
| unsigned int *
In file included from ../vkd3d/libs/vkd3d-shader/hlsl_codegen.c:21:
../vkd3d/libs/vkd3d-shader/hlsl.h:1171:52: note: expected 'enum vkd3d_sm4_register_type *' but argument is of type 'unsigned int *'
1171 | bool output, enum vkd3d_sm4_register_type *type, enum vkd3d_sm4_swizzle_type *swizzle_type, bool *has_idx);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
2023-04-21 20:55:56 +02:00
Nikolay Sivov
317b8aa039
vkd3d-shader/hlsl: Ignore "unroll" attribute for loops.
2023-04-21 20:55:48 +02:00
Henri Verbeet
8e0df3f720
vkd3d-shader/sm1: Merge hlsl_sm1.c into d3dbc.c.
2023-04-20 22:54:32 +02:00
Henri Verbeet
99bc07ccf5
vkd3d-shader/sm4: Merge sm4.h into tpf.c.
2023-04-20 22:54:31 +02:00
Henri Verbeet
7800c7b40f
vkd3d-shader/sm4: Rename hlsl_sm4.c to tpf.c.
2023-04-20 22:54:30 +02:00
Henri Verbeet
804e315b68
vkd3d-shader/sm4: Move the TPF parser from dxbc.c to hlsl_sm4.c.
2023-04-20 22:54:28 +02:00
Zebediah Figura
0959c6663f
vkd3d-shader/hlsl: Remove an unused local variable from create_loop().
2023-04-20 22:54:13 +02:00
Zebediah Figura
39a03cfd22
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_load_component().
2023-04-20 22:54:12 +02:00
Zebediah Figura
a98686ed78
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from add_load_component().
2023-04-20 22:54:11 +02:00
Zebediah Figura
e5ec431784
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_jump().
2023-04-20 22:54:10 +02:00
Zebediah Figura
dfe056596a
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_int_constant().
2023-04-20 22:54:09 +02:00
Ethan Lee
0668d32631
vkd3d-shader/hlsl: Add support for any() intrinsic.
...
For now, this is limited to float and bool, scalar and vector. All other types are unsupported.
Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
2023-04-19 20:46:53 +02:00
Francisco Casas
3f9cd58f5b
vkd3d-shader/hlsl: Fix missing extern resource names.
2023-04-19 20:46:53 +02:00
Nikolay Sivov
827a359b45
vkd3d-shader/hlsl: Handle uppercase regset names in packoffset().
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-04-19 20:45:50 +02:00
Nikolay Sivov
0cea4d352e
vkd3d-shader/hlsl: Handle uppercase regset names in register().
2023-04-19 20:45:48 +02:00
Zebediah Figura
d8ef0c69a8
vkd3d-shader/spirv: Do not declare resources as multisampled if the sample count is 1.
...
It is illegal to match a SPIR-V multisampled resource to a Vulkan resource which
is not multisampled. Vulkan considers a resource to be multisampled if its
sample count is greater than 1 (and SPIR-V does not care about the sample count).
This fixes validation errors in the case where the sample count does actually
match the resource. In order to provide correct behaviour when there is a
mismatch, or when the sample count is missing, we will need yet another
additional interface. In the absence of that it seems best to provide a best
guess.
This fixes a validation error with the not-yet-committed merge request 135, when
the d3d11 runner is run through Wine with the Vulkan backend.
2023-04-19 20:45:39 +02:00
Nikolay Sivov
dfe923ea1d
vkd3d-shader: Consistently pass location structure by pointer.
2023-04-19 20:45:31 +02:00
Zebediah Figura
7ee66351c8
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_if().
2023-04-18 21:59:49 +02:00
Zebediah Figura
50f0ae1b21
vkd3d-shader/hlsl: Pass hlsl_block pointers to hlsl_new_if().
2023-04-18 21:59:45 +02:00
Zebediah Figura
5a3fe1609b
vkd3d-shader/hlsl: Initialize the block in clone_block().
2023-04-18 21:59:44 +02:00
Zebediah Figura
733141720a
vkd3d-shader/hlsl: Introduce a hlsl_block_cleanup() helper.
2023-04-18 21:59:42 +02:00
Zebediah Figura
dc7514afc9
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_float_constant().
2023-04-18 21:59:39 +02:00
Zebediah Figura
b23ef3ca3b
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_cast() and hlsl_new_copy().
2023-04-18 21:59:37 +02:00
Zebediah Figura
1bf3aa9275
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_bool_constant().
2023-04-18 21:59:34 +02:00
Zebediah Figura
0654d88edd
vkd3d-shader/hlsl: Allow VPOS and VFACE to be specified in sm3 pixel shaders.
...
We were previously (accidentally) rejecting them because they didn't have a
usage.
2023-04-18 21:59:22 +02:00
Zebediah Figura
b19105eaeb
vkd3d-shader/hlsl: Do not write DCL instructions for ps_1_* shaders.
2023-04-18 21:59:17 +02:00
Zebediah Figura
99d413206b
vkd3d-shader/hlsl: Map ps_1_* color and texcoord semantics to registers.
2023-04-18 21:59:15 +02:00
Zebediah Figura
98e2461392
vkd3d-shader/hlsl: Sort only uniforms by name in the sm1 backend.
2023-04-18 21:59:13 +02:00
Zebediah Figura
8ed7437708
vkd3d-shader/hlsl: Evaluate index before array.
...
Co-authored-by: Francisco Casas <fcasas@codeweavers.com>
2023-04-13 23:05:43 +02:00
Francisco Casas
af1aa63ace
vkd3d-shader/hlsl: Support column-major matrix indexing in the lhs.
2023-04-13 23:05:41 +02:00
Francisco Casas
dc2a34824d
vkd3d-shader/hlsl: Always load from a synthetic copy in add_load_component().
2023-04-13 23:05:39 +02:00
Francisco Casas
82ff408451
vkd3d-shader/hlsl: Remove add_load_index().
2023-04-13 23:05:34 +02:00
Francisco Casas
5c285adc6b
vkd3d-shader/hlsl: Use hlsl_ir_index for array and record access.
...
From this point on, it is no longer true that only hlsl_ir_loads can
return objects, because an object can also come from chain of
hlsl_ir_indexes that ends in an hlsl_ir_load.
The lower_index_loads pass takes care of lowering all hlsl_ir_indexes
into hlsl_ir_loads.
For this reason, hlsl_resource_load_params now expects both the resource
as the sampler to be just an hlsl_ir_node pointer instead of a pointer
to a more specific hlsl_ir_load.
2023-04-13 23:05:32 +02:00
Francisco Casas
741c9e5893
vkd3d-shader/hlsl: Introduce hlsl_ir_index.
...
This node type is intended for use during parse-time.
While we parse an indexing expression such as "a[3]", we don't know if
it will end up as part of an expression (in which case it must be folded
into a load) or it is for the lhs of a store (in which case it must be
folded into the store's deref).
2023-04-13 23:05:25 +02:00
Francisco Casas
0ceecd1225
vkd3d-shader/hlsl: Fix numeric offset of object fields.
2023-04-13 23:05:07 +02:00
Nikolay Sivov
ca59a3c35b
vkd3d-shader/hlsl: Handle SV_IsFrontFace semantic.
2023-04-13 23:04:58 +02:00
Nikolay Sivov
a1bd4e080e
vkd3d-shader/hlsl: Support log() intrinsic.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-04-13 23:04:44 +02:00
Nikolay Sivov
210caa931d
vkd3d-shader/hlsl: Support log10() intrinsic.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-04-13 23:04:42 +02:00
Nikolay Sivov
49b63fbeba
vkd3d-shader/hlsl: Support log2() intrinsic.
2023-04-13 23:04:40 +02:00