Commit Graph

454 Commits

Author SHA1 Message Date
Conor McCarthy
eabdccb117 vkd3d-shader/ir: Merge all shader IR fork and join phases into a single phase.
Normalise the incoming vkd3d_shader_instruction IR to the shader model 6
pattern. This allows generation of a single patch constant function in
SPIR-V.
2023-04-03 17:58:21 +02:00
Nikolay Sivov
ee52ad8106 vkd3d-shader/trace: Output sample count for multisampled resources. 2023-03-08 20:15:06 +01:00
Conor McCarthy
3b5316be82 vkd3d-shader/dxbc: Emit a shader error for an invalid signature data size. 2023-03-08 20:14:57 +01:00
Henri Verbeet
c87492ed21 vkd3d-shader/dxbc: Introduce API for parsing DXBC blobs. 2023-02-23 21:47:26 +01:00
Henri Verbeet
3a3acb5b7d vkd3d-shader/dxbc: Pass a vkd3d_shader_code structure to shader_parse_input_signature(). 2023-02-23 21:47:20 +01:00
Henri Verbeet
bf3c012834 vkd3d-shader/dxbc: Rename the dxbc_writer_section structure to vkd3d_shader_dxbc_section_desc.
In preparation of exposing it in the public API.
2023-02-23 21:47:15 +01:00
Henri Verbeet
b59de4de5c vkd3d-shader/dxbc: Store DXBC section data as a vkd3d_shader_code structure. 2023-02-23 21:47:13 +01:00
Conor McCarthy
d14f42be9d vkd3d-shader/spirv: Pass a parser pointer to spirv_compiler_generate_spirv(). 2023-01-24 18:11:16 +01:00
Conor McCarthy
2a5ae0a8c6 vkd3d-shader/sm4: Use the instruction array interface in compile_dxbc_tpf(). 2023-01-24 18:11:14 +01:00
Conor McCarthy
e9a2642d6a vkd3d-shader/trace: Use the instruction array interface in vkd3d_dxbc_binary_to_text(). 2023-01-24 18:11:10 +01:00
Conor McCarthy
e8cb90608d vkd3d-shader: Initialise the instruction array in vkd3d_shader_parser_init(). 2023-01-24 18:11:10 +01:00
Conor McCarthy
a9aaa59df0 vkd3d-shader/sm4: Store parsed instructions in an array. 2023-01-24 18:11:08 +01:00
Conor McCarthy
007f894b94 vkd3d-shader/sm1: Store parsed instructions in an array. 2023-01-24 18:11:06 +01:00
Zebediah Figura
9c817e5e6d vkd3d-shader/hlsl: Forbid recursive calls. 2023-01-19 19:16:27 +01:00
Zebediah Figura
718c79b823 vkd3d-shader/hlsl: Parse the numthreads attribute. 2022-11-08 20:53:04 +01:00
Zebediah Figura
d6799bd5d3 vkd3d-shader/hlsl: Parse function attributes. 2022-11-08 20:53:03 +01:00
Zebediah Figura
e2aed38509 vkd3d-shader/spirv: Avoid using DXBC-specific definitions. 2022-11-08 20:52:32 +01:00
Zebediah Figura
35b48a8b04 vkd3d-shader/spirv: Rename struct vkd3d_dxbc_compiler to struct spirv_compiler.
We would like to generate SPIR-V for input formats other than DXBC.

The "vkd3d_" prefix is dropped, partly to make names shorter, and partly to help
clarify what is an internal function.

I prefer avoiding the vkd3d_* prefix on all internal functions, for these
reasons. However, I'm open to restoring it.
2022-11-08 20:52:29 +01:00
Francisco Casas
6989266e76 vkd3d-shader/hlsl: Check for non-static object references.
It is responsibility of the shader's programmer to ensure that
object references can be solved statically.

Resource arrays for ps_5_1 and vs_5_1 are an exception which is not
properly handled yet. They probably deserve a different object type.

Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
2022-08-23 15:57:54 -05:00
Matteo Bruni
228f7ab5cd vkd3d-shader/hlsl: Handle over/underflow when parsing integer literals.
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: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-12 19:33:56 +02:00
Giovanni Mascellani
40b299c727 vkd3d-shader/hlsl: Fold constant division.
This commit includes work by Francisco Casas.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Francisco Casas <fcasas@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-15 21:18:17 +02:00
Zebediah Figura
fa17a170b1 vkd3d-shader/sm4: Recognise the msad opcode.
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-03-14 18:31:08 +01:00
Henri Verbeet
cea9f19bd4 vkd3d-shader/d3d-asm: Always use '.' as decimal separator when printing doubles.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:31:33 +01:00
Henri Verbeet
aef9e9ea62 vkd3d-shader/d3d-asm: Always use '.' as decimal separator when printing floats.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:31:33 +01:00
Henri Verbeet
4728cf1286 include: Introduce a common macro for defining tags.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:31:33 +01:00
Henri Verbeet
ab45f0cafd vkd3d-shader: Explicitly handle VKD3D_DATA_MIXED in vkd3d_component_type_from_data_type().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-28 22:23:18 +01:00
Henri Verbeet
f5c4c06090 vkd3d-shader/hlsl: Respect the requested target type.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-28 22:23:13 +01:00
Zebediah Figura
7f166c4da4 vkd3d-shader/hlsl: Return false from hlsl_offset_from_deref() if the offset falls out of bounds.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Francisco Casas <fcasas@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-24 18:39:11 +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
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
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
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
Zebediah Figura
2edec69da4 vkd3d-shader: Make shader_extract_from_dxbc() static.
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-06 11:34:19 +01: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Zebediah Figura
d27fee64ab build: Make the default symbol visibility "hidden".
We tag far fewer symbols this way.

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-09 21:43:22 +02:00
Zebediah Figura
688cdb218e vkd3d-shader: Move SM4 byte code definitions to a separate header.
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-06 12:31:17 +02:00
Conor McCarthy
fabadf584f vkd3d-shader: Implement DNE 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-04 18:21:43 +02:00
Conor McCarthy
4ea3da3067 vkd3d-shader: Implement DLT 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-04 18:21:41 +02:00
Conor McCarthy
df60cffef1 vkd3d-shader: Implement DGE 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-04 18:21:38 +02:00
Conor McCarthy
eb804a5a9f vkd3d-shader: Implement DADD 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-03 15:57:27 +02:00
Conor McCarthy
506c98b4a2 vkd3d-shader: Handle 64-bit immediate constant registers.
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-03 15:57:21 +02:00
Conor McCarthy
a9eadaa06a vkd3d-shader: Add a 64-bit immediate constant register type.
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-03 15:57:18 +02:00
Conor McCarthy
4e63842a73 vkd3d-shader: Implement DMOV 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-07-28 19:59:03 +02:00
Zebediah Figura
70017e0e9e vkd3d-shader: Move the bytecode buffer helpers to vkd3d_shader_main.c.
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-07-27 13:55:42 +02:00
Conor McCarthy
85eff9373d vkd3d-shader: Introduce to struct vkd3d_symbol a descriptor array symbol 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-07-26 17:35:18 +02:00
Conor McCarthy
59cf70142a vkd3d-shader: Implement DEQ instruction.
Source modifiers and immediate constants are not supported.

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-07-22 21:11:13 +02:00
Conor McCarthy
4b919a10ad vkd3d-shader: Add shader component type double.
Based 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-07-19 12:14:20 +02:00
Conor McCarthy
d027ac4c15 vkd3d-shader: Enable Float64 capability if flagged in DXBC.
Based 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-07-19 12:14:16 +02:00
Conor McCarthy
57faa09dc0 vkd3d-shader: Introduce shader_sm4_error() for reporting via vkd3d_shader_verror().
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-07-02 16:45:28 +02:00
Zebediah Figura
dd03242417 vkd3d-shader: Allocate constant buffers.
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-06-28 13:44:05 +02:00
Conor McCarthy
533d901a24 vkd3d-shader: Store a vkd3d_shader_register_range structure in struct vkd3d_shader_constant_buffer.
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-06-24 21:49:17 +02:00
Conor McCarthy
1b716f8c28 vkd3d-shader: Store a vkd3d_shader_register_range structure in struct vkd3d_shader_sampler.
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-06-24 21:49:14 +02:00
Conor McCarthy
af2714832b vkd3d-shader: Introduce struct vkd3d_shader_register_range.
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-06-24 21:49:12 +02:00
Zebediah Figura
001328e084 vkd3d-shader: Use yy_scan_bytes() instead of yy_scan_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: Alexandre Julliard <julliard@winehq.org>
2021-03-09 11:58:02 +01:00
Zebediah Figura
48a1db2976 vkd3d-shader: Return a vkd3d_string_buffer from 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: Alexandre Julliard <julliard@winehq.org>
2021-03-02 20:43:49 +01:00
Zebediah Figura
87a371292d vkd3d-shader: Implement hlsl_note().
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-02-23 20:20:26 +01:00
Zebediah Figura
6124aa664f vkd3d-shader: Implement hlsl_error() and hlsl_warning().
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-02-23 20:20:22 +01:00
Henri Verbeet
804d191aee vkd3d-shader: Recognise the "raw_buffer" and "structured_buffer" shader model 5 resource types.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-19 21:12:43 +01:00
Henri Verbeet
3bacb33556 vkd3d-shader: Parse shader model 5 resource strides.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-19 21:12:43 +01:00
Henri Verbeet
6680d9e865 vkd3d-shader: Add some colour to d3d-asm opcodes.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-16 16:00:13 +01:00
Henri Verbeet
8315d319f6 vkd3d-shader: Rename VKD3D_SHADER_INSTRUCTION_HANDLER to vkd3d_shader_opcode.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-16 16:00:03 +01:00
Zebediah Figura
16aceacc0c vkd3d-shader: Implement global resource memory barriers.
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-02-04 22:32:42 +01:00
Zebediah Figura
b523122ef3 vkd3d-shader: Import the HLSL compiler from Wine.
This corresponds to Wine commit 9f9fec18799bf59df6211b7294f8d338caa7f4db.

Note that for the moment, compilation messages have not been ported.

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-01-29 20:54:19 +01:00
Zebediah Figura
be7e06cd4a vkd3d-shader: Implement multiplication and division in #if directives.
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-01-21 23:02:31 +01:00
Zebediah Figura
1a326d16c6 vkd3d-shader: Implement #error.
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-01-18 20:15:56 +01:00
Zebediah Figura
e1a956f8f2 vkd3d-shader: Implement function-like macro expansion.
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-01-14 21:12:17 +01:00
Zebediah Figura
8c927c491c vkd3d-shader: Implement #include.
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-01-12 20:35:02 +01:00
Zebediah Figura
9a1317ff0f vkd3d-shader: Partially implement #define.
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-01-12 20:34:56 +01:00
Zebediah Figura
86cb863bc2 vkd3d-shader: Implement basic support for #if and #endif.
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-01-04 21:01:04 +01:00
Zebediah Figura
5304cabf46 vkd3d-shader: Handle preprocessor parsing errors.
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-01-04 21:01:00 +01:00
Zebediah Figura
cdfca2fab7 vkd3d-shader: Move location tracking out of the vkd3d_shader_message_context structure.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-15 22:19:32 +01:00
Zebediah Figura
f544cb38e5 vkd3d-shader: Implement an initial pass-through HLSL preprocessor.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-09 19:59:49 +01:00
Zebediah Figura
5fb9bcdd14 vkd3d-shader: Don't allocate an initial buffer in vkd3d_string_buffer_init().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-09 16:15:12 +02:00
Zebediah Figura
0072fb213a vkd3d-shader: Pass the output pointer to vkd3d_shader_message_context_copy_messages().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-09 16:15:08 +02:00
Isabella Bosia
9136e56435 vkd3d-shader: Parse all 4 data type components.
Signed-off-by: Isabella Bosia <ibosia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-28 15:00:26 +02:00
Isabella Bosia
8d9d20d47b vkd3d-shader: Add valid vkd3d_sm4_data_type types.
Signed-off-by: Isabella Bosia <ibosia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-28 15:00:23 +02:00
Isabella Bosia
a0d469b20e vkd3d-shader: Add vkd3d_dxbc_binary_to_text() helper function.
Signed-off-by: Isabella Bosia <ibosia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-25 16:11:51 +02:00
Isabella Bosia
058aec3ad9 vkd3d-shader: Recognize skipOptimization global flag.
Signed-off-by: Isabella Bosia <ibosia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-16 17:12:39 +02:00
Zebediah Figura
7dd8c15d49 vkd3d-shader: Read the SM5 resource data type instruction modifier.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-07 21:01:00 +02:00
Zebediah Figura
c3a5df7375 vkd3d-shader: Read the SM5 resource type instruction modifier.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-07 21:00:58 +02:00
Zebediah Figura
9a0692978e vkd3d-shader: Allow structures to be chained in any order.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-25 23:01:59 +02:00
Henri Verbeet
d2ffae5900 vkd3d-shader: Introduce API for descriptor array bindings.
We will need this for shader model 5.1 resource arrays. However, for the
time being any count other than '1' is unsupported.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-20 22:01:38 +02:00
Zebediah Figura
3244fa3f92 vkd3d-shader: Remove the unused "ctx" field from struct vkd3d_shader_instruction.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-12 22:11:37 +02:00
Henri Verbeet
1496dc054e vkd3d-shader: Add a compiler message for unhandled register types in vkd3d_dxbc_compiler_get_descriptor_binding().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-04 15:52:22 +02:00
Henri Verbeet
cf3c50b705 vkd3d-shader: Fail shader compilation if any descriptor bindings are missing.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-04 15:52:20 +02:00
Henri Verbeet
1279d5df9e vkd3d-shader: Report error messages from vkd3d_shader_serialize_root_signature().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:33:00 +02:00
Henri Verbeet
33eb944bf4 vkd3d-shader: Report error messages from vkd3d_shader_parse_root_signature().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:32:59 +02:00
Henri Verbeet
d135b4687b vkd3d-shader: Report error messages from vkd3d_shader_parse_input_signature().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:32:57 +02:00
Henri Verbeet
11f82d985c vkd3d-shader: Pass a vkd3d_shader_compile_info structure to vkd3d_shader_scan_dxbc().
In order to allow it to handle different source types.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:32:56 +02:00
Henri Verbeet
1c8077546e vkd3d-shader: Validate control flow instructions in vkd3d_shader_scan_dxbc().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:32:54 +02:00
Henri Verbeet
29287d3368 vkd3d-shader: Add compiler messages for invalid DXBC chunk offsets and sizes.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 19:44:04 +02:00
Henri Verbeet
29e9cf032c vkd3d-shader: Add a compiler message for unsupported DXBC versions.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 19:44:01 +02:00
Henri Verbeet
9fcf00e2bf vkd3d-shader: Validate DXBC checksums.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 19:43:59 +02:00
Henri Verbeet
1f6ce3ceba vkd3d-shader: Add a compiler message for invalid DXBC magic.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 19:43:56 +02:00
Henri Verbeet
3b2fb3aba1 vkd3d-shader: Output a compiler error message if the DXBC size is invalid.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 19:43:52 +02:00
Henri Verbeet
edd585ea44 vkd3d-shader: Rename the VKD3D_SWIZZLE macro to VKD3D_SHADER_SWIZZLE.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-10 17:08:17 +02:00
Henri Verbeet
2da59a1056 vkd3d-shader: Rename the vkd3d_component_type enumeration to vkd3d_shader_component_type.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-10 17:08:14 +02:00
Henri Verbeet
11980c3944 vkd3d-shader: Introduce struct vkd3d_shader_resource.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-30 21:05:14 +02:00
Henri Verbeet
cf04ed68a7 vkd3d-shader: Report descriptor resource types in vkd3d_shader_scan_dxbc().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-25 09:57:42 +02:00
Henri Verbeet
7e4fc14a31 vkd3d-shader: Rename the vkd3d_tessellator_partitioning enumeration.
To vkd3d_shader_tessellator_partitioning.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 16:25:21 +02:00
Henri Verbeet
500079a54a vkd3d-shader: Rename the vkd3d_tessellator_output_primitive enumeration.
To vkd3d_shader_tessellator_output_primitive, consistent with vkd3d-shader
naming conventions.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 16:25:18 +02:00
Henri Verbeet
b07c304440 vkd3d-shader: Pass compile options as an array instead of as flags.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-19 16:08:29 +02:00
Henri Verbeet
9312979b56 vkd3d-shader: Pass the target info as part of the vkd3d_shader_compile_info structure chain.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-19 16:08:28 +02:00
Henri Verbeet
c4e6657c11 vkd3d-shader: Pass the interface info as part of the vkd3d_shader_compile_info structure chain.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-19 16:08:26 +02:00
Henri Verbeet
5ee018afe9 vkd3d-shader: Rename the vkd3d_shader_compile_arguments structure to vkd3d_shader_spirv_target_info.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-18 21:21:41 +02:00
Zebediah Figura
6dace4a8be vkd3d-shader: Read the resource index from idx[1] instead of idx[0] when looking up SM5.1 bindings.
We still use the first index to uniquely identify the register in vkd3d_symbol,
only changing which field is used to declare it.

This patch does not handle descriptor arrays.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-27 22:04:57 +02:00
Henri Verbeet
61799500e2 vkd3d-shader: Handle normalised types in vkd3d_component_type_from_data_type().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 20:11:18 +01:00
Hans-Kristian Arntzen
7a7ed132ec vkd3d-shader: Fix MSVC build.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 19:15:16 +02:00
Józef Kucia
267f10df8b vkd3d-shader: Handle interpolation mode in vkd3d_dxbc_compiler_emit_input().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-14 20:13:09 +02:00
Józef Kucia
de3423e98e vkd3d-shader: Improve asserts for write mask component count.
Helps Clang Static Analyzer.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-01 22:54:16 +02:00
Józef Kucia
c77f02ca01 vkd3d-shader: Add support for parsing Shader Model 5.1 bytecode.
Translation to SPIR-V isn't implemented yet.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-30 09:25:40 +02:00
Józef Kucia
c6477964a3 vkd3d-shader: Translate eval_centroid shader instructions.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-14 23:53:29 +01:00
Józef Kucia
74c8ca0f64 vkd3d-shader: Add basic support for vocp registers.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-06 16:00:37 +01:00
Józef Kucia
b6de566e3a vkd3d-shader: Add basic support for dcl_index_range.
We can address SPIR-V arrays dynamically.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-20 19:15:10 +01:00
Józef Kucia
3fbbc68160 vkd3d-shader: Replace VKD3DSIH_TABLE_SIZE with VKD3DSIH_INVALID.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-20 19:14:58 +01:00
Józef Kucia
c333fddaf9 vkd3d-shader: Add support for OpenGL tessellation shaders.
In DXBC tessellator parameters are specified in hull shaders. In OpenGL,
even in SPIR-V, tessellator parameters must be specified in the
tessellation evaluation shader.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-14 16:01:14 +01:00
Józef Kucia
1ae1f831f6 vkd3d-shader: Move VKD3D_SHADER_DUMP_PATH implementation from libvkd3d.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-31 18:05:51 +01:00
Józef Kucia
fd0844e420 vkd3d-shader: Avoid using private variables for depth output registers.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-23 17:42:58 +01:00
Józef Kucia
4c0692b2ef vkd3d-shader: Rename vkd3d_shader_interface to vkd3d_shader_interface_info.
For consistency with other vkd3d and vkd3d-shader structures.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-17 19:44:05 +01:00
Józef Kucia
49e55dd639 vkd3d-shader: Implement DXBC checksum for root signatures.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-20 19:41:44 +01:00
Józef Kucia
3795add878 vkd3d-shader: Import MD5 implementation from Wine.
With style changes.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-20 19:41:41 +01:00
Józef Kucia
4e66897a1e vkd3d-shader: Avoid BYTE.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-12 17:28:16 +01:00
Józef Kucia
a7aaa09eb3 vkd3d-shader: Avoid BOOL.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-12 17:28:16 +01:00
Józef Kucia
8ac9b120fe vkd3d-shader: Avoid SIZE_T.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-13 20:49:43 +01:00
Józef Kucia
11a65da62a vkd3d-shader: Check more accurately if swizzle is required.
Eliminates redundant OpVectorShuffle instructions.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-31 19:15:15 +01:00
Józef Kucia
6b9c589795 vkd3d-shader: Implement vkd3d_write_mask_component_count() on top of vkd3d_popcount().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-30 18:21:55 +01:00
Józef Kucia
bec3430d88 vkd3d-shader: Propagate errors from vkd3d_dxbc_compiler_emit_control_flow_instruction().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-26 19:47:14 +02:00
Józef Kucia
970aafaf55 vkd3d-shader: Recognize enableMinimumPrecision global flag.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-11 18:37:34 +02:00
Józef Kucia
054b1e41dd libs/vkd3d-shader: Treat vicp register as regular shader input.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-18 17:52:31 +02:00
Józef Kucia
7dce007c53 libs/vkd3d-shader: Add initial support for typed registers.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:42 +02:00
Józef Kucia
49e936ae2a libs/vkd3d-shader: Factor out shader_dump_instruction_flags().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-06 00:04:32 +02:00
Józef Kucia
a5808cfdd7 libs/vkd3d-shader: Import shader tracing from wined3d.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-29 19:33:04 +02:00
Józef Kucia
2fa29dd823 libs/vkd3d-shader: Recognize more shader registers.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-29 19:32:52 +02:00
Józef Kucia
3ddb29c16a libs/vkd3d-shader: Parse precise flags.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-29 19:32:48 +02:00
Józef Kucia
40ee9fa0e9 libs/vkd3d-shader: Implement swizzling for shader outputs.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-24 23:29:24 +02:00
Józef Kucia
926f844ead libs/vkd3d-shader: Rework swizzle macros.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-24 23:29:20 +02:00
Józef Kucia
83ce4553ea libs/vkd3d-shader: Introduce VKD3DSPR_INVALID.
Fixes clang warnings.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-13 19:08:05 +02:00
Józef Kucia
6a1b3a3fb5 libs/vkd3d-shader: Validate DXBC data size.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-11 18:56:08 +02:00
Józef Kucia
5ea8cad967 libs/vkd3d-shader: Avoid UINT.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-15 20:00:37 +01:00
Józef Kucia
844c83a837 libs/vkd3d-shader: Avoid Windows data types in public API.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-15 20:00:35 +01:00
Józef Kucia
b19fe74284 libs/vkd3d-shader: Export shader signature parsing. 2017-09-11 22:35:16 +02:00
Józef Kucia
5bdc928908 libs/vkd3d-shader: Export shader scan function.
For UAV counters support in libvkd3d.
2017-09-01 11:27:58 +02:00
Józef Kucia
e11b5fd566 libs/vkd3d-shader: Implement scanning for UAV counters. 2017-09-01 11:27:58 +02:00
Józef Kucia
6c5d8da24d libs/vkd3d-shader: Store structure stride in symbol table. 2017-08-22 14:53:33 +02:00
Józef Kucia
d5697448eb libs/vkd3d-shader: Translate dcl_resource_structured instructions. 2017-08-22 12:39:56 +02:00
Józef Kucia
d287591889 libs/vkd3d-shader: Set image format for UAV typed reads and atomic instructions. 2017-08-21 12:41:07 +02:00
Józef Kucia
a90c7c5f12 libs/vkd3d-shader: Add basic shader scan functionality. 2017-08-21 12:41:07 +02:00
Józef Kucia
8f631c8b0c libs/vkd3d-shader: Make bytecode parser responsible for setting scalar register write masks. 2017-08-18 14:52:40 +02:00
Józef Kucia
e3d6bac31b libs/vkd3d-shader: Introduce vkd3d_shader_interface structure. 2017-08-16 13:11:52 +02:00
Józef Kucia
92fcb9ffa2 libs/vkd3d-shader: Add support for push constants. 2017-07-27 15:24:38 +02:00
Józef Kucia
edd1e9602d libs/vkd3d-shader: Implement arbitrary mappings from D3D shader register to Vulkan descriptors.
An arbitrary mapping can be passed to vkd3d_shader_compile_dxbc().
2017-07-26 13:45:25 +02:00
Józef Kucia
6c174beb4b libs/vkd3d-shader: Use component types from input signatures for shader inputs.
Fixes Vulkan validation layers errors.
2017-07-25 14:23:27 +02:00
Józef Kucia
cc536e72ab libs/vkd3d-shader: Translate sample instructions. 2017-07-17 16:25:29 +02:00
Józef Kucia
682e725d6e libs/vkd3d-shader: Add support for multiple shader outputs packed into single register. 2017-07-10 15:33:34 +02:00
Józef Kucia
4c448f0a35 libs/vkd3d-shader: Recognize vThreadID register. 2017-07-10 15:33:34 +02:00
Józef Kucia
3f03cd1ec8 libs/vkd3d-shader: Implement root signature parsing. 2017-06-27 13:16:47 +02:00
Józef Kucia
cb79f2ec65 libs/vkd3d-shader: Implement floating-point comparison instructions. 2017-06-26 17:03:31 +02:00
Józef Kucia
f5e3b248df libs/vkd3d-shader: Fix SV_Position in pixel shaders. 2017-06-21 22:00:19 +02:00
Józef Kucia
95b11ba336 libs/vkd3d-shader: Translate dcl_input instructions. 2017-06-20 17:09:39 +02:00
Józef Kucia
801b4159de libs/vkd3d-shader: Translate some ALU instructions. 2017-06-20 14:14:44 +02:00
Józef Kucia
2b1396e7e4 libs/vkd3d-shader: Translate mov instruction. 2017-06-20 13:34:44 +02:00
Józef Kucia
1f65d4ccc1 libs/vkd3d-shader: Add stub for SPIR-V generator. 2017-06-19 18:05:53 +02:00
Józef Kucia
4ab5ced2fc libs/vkd3d-shader: Import DXBC parser from Wine d3d11 implementation. 2017-06-16 22:38:21 +02:00
Józef Kucia
31c6bfe24f libs/vkd3d-shader: Import SM4+ bytecode parser from Wine. 2017-06-16 22:38:21 +02:00
Józef Kucia
93458c8933 libs/vkd3d-shader: Add library. 2017-06-16 22:38:21 +02:00