Zebediah Figura
4695690ac8
vkd3d-shader: Parse 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-06-23 15:07:48 +02:00
Zebediah Figura
c30ad6ddea
vkd3d-shader: Get rid of HLSL_IR_SEQUENCE.
...
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-06-23 15:07:46 +02:00
Zebediah Figura
e81989492c
vkd3d-shader: Rename the "regnum" field of struct hlsl_reg_reservation to "index".
...
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-06-23 15:07:44 +02:00
Zebediah Figura
e8e138ed54
vkd3d-shader: Store the hlsl_reg_reservation struct directly.
...
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-18 21:08:22 +02:00
Zebediah Figura
bb79ca76ae
vkd3d-shader: Store the register type for reservations as a char.
...
Essentially because the meaning of 'b' differs between SM1-3 and 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: Alexandre Julliard <julliard@winehq.org>
2021-06-18 21:08:20 +02:00
Zebediah Figura
6493953516
vkd3d-shader: Distinguish between resource exhaustion and invalid shaders when returning failure.
...
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-05-31 17:44:02 +02:00
Zebediah Figura
ba1cc670e6
vkd3d-shader: Use the HLSL string buffer cache in hlsl_type_to_string() and hlsl_modifiers_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-05-31 17:43:59 +02:00
Zebediah Figura
4fe1e86310
vkd3d-shader: Introduce HLSL string buffer 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-05-31 17:43:57 +02:00
Zebediah Figura
49726b0e64
vkd3d-shader: Introduce HLSL allocation helpers.
...
To automatically put the compilation context in a failed state.
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-05-31 17:43:54 +02:00
Zebediah Figura
0c3b1d1d89
vkd3d-shader: Avoid using the term "varying" for all semantics.
...
It's not particularly accurate; "varying" only refers to the interface between
two consecutive shader stages.
Replace it with "semantic" in most 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: Alexandre Julliard <julliard@winehq.org>
2021-05-10 18:09:26 +02:00
Zebediah Figura
445165823e
vkd3d-shader: Parse the semantic index in hlsl_parse().
...
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-05-10 18:09:24 +02:00
Zebediah Figura
549be35c0a
vkd3d-shader: Only mark entry point parameters as uniform, input, or output.
...
In fact, don't even mark them directly; only mark the synthetic variables.
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-05-10 18:09:20 +02:00
Zebediah Figura
16e549e579
vkd3d-shader: Write SM1 constant definitions.
...
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-05-10 18:09:18 +02:00
Zebediah Figura
aab9482758
vkd3d-shader: Rename name_offset to name_bytecode_offset.
...
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-05-10 18:09:12 +02:00
Zebediah Figura
b87e9b0652
vkd3d-shader: Write the SM1 constant table.
...
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-04-20 18:27:09 +02:00
Zebediah Figura
8f26986615
vkd3d-shader: Store variables with external linkage in a dedicated list.
...
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-04-20 18:27:03 +02:00
Zebediah Figura
44816403f1
vkd3d-shader: Write empty SM1 shaders.
...
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-04-20 18:27:00 +02:00
Zebediah Figura
21b4052247
vkd3d-shader: Allocate constant registers for anonymous constants.
...
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-04-13 22:59:51 +02:00
Zebediah Figura
60ece9cd62
vkd3d-shader: Store the shader type and version in the hlsl_ctx structure.
...
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-04-13 22:59:49 +02:00
Zebediah Figura
e957d3a346
vkd3d-shader: Allocate temporary registers for anonymous expressions.
...
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-04-13 22:59:47 +02:00
Zebediah Figura
16163021b9
vkd3d-shader: Allocate temporary registers for variables.
...
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-04-13 22:59:44 +02:00
Zebediah Figura
027f994fe0
vkd3d-shader: Rename HLSL_IR_ASSIGNMENT to HLSL_IR_STORE.
...
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-04-13 22:59:41 +02:00
Zebediah Figura
5ad94644ec
vkd3d-shader: Store the function return semantic in the return variable.
...
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-03-30 20:38:38 +02:00
Zebediah Figura
c16a07caff
vkd3d-shader: Use separate flag fields to track whether a variable is a uniform or varying.
...
Mostly in order to make it clearer that these don't directly correspond to the
modifiers with which the variable was declared.
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-03-24 20:48:46 +01:00
Zebediah Figura
e285fc57d2
vkd3d-shader: Forbid storage modifiers on struct fields.
...
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-03-24 20:48:42 +01:00
Zebediah Figura
6d10d887d0
vkd3d-shader: Factor out hlsl_new_load().
...
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-03-22 15:36:54 +01:00
Zebediah Figura
3ac20487f8
vkd3d-shader: Rename hlsl_type_compare() to hlsl_types_are_equal().
...
hlsl_type_compare() implies a stable comparison function, as if to be passed to
qsort().
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-22 15:36:52 +01:00
Zebediah Figura
8096e4ae7b
vkd3d-shader: Factor out hlsl_new_copy().
...
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-17 22:09:51 +01:00
Zebediah Figura
363a4334e9
vkd3d-shader: Lower postincrement and postdecrement to assignment operations at parse time.
...
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-15 20:39:09 +01:00
Zebediah Figura
1cd208fb32
vkd3d-shader: Lower preincrement and predecrement to assignment operations at parse time.
...
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-15 20:39:07 +01: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
8ce33da2ab
vkd3d-shader: Move the remainder of hlsl_parser_compile() to hlsl_compile_shader().
...
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-05 18:00:22 +01:00
Zebediah Figura
df5e4a865c
vkd3d-shader: Move some functions into hlsl_codegen.c.
...
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-03-04 19:55:46 +01:00
Zebediah Figura
3d5a4f133a
vkd3d-shader: Print the previous location for redefinition 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-03-04 19:55:32 +01:00
Zebediah Figura
0f4d62b09d
vkd3d-shader: Factor out hlsl_new_loop().
...
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:44:02 +01:00
Zebediah Figura
ccd67dcf37
vkd3d-shader: Factor out hlsl_new_jump().
...
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-03-02 20:43:59 +01:00
Zebediah Figura
35105d4e29
vkd3d-shader: Return a vkd3d_string_buffer from hlsl_modifiers_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:53 +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
7069fa1c40
vkd3d-shader: Replace hlsl_message() with hlsl_error().
...
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-02-23 20:20:24 +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
Zebediah Figura
124069907d
vkd3d-shader: Get rid of hlsl_base_type_to_string().
...
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-19 21:06:58 +01:00
Zebediah Figura
b57ad006c2
vkd3d-shader: Avoid using debugging utilities in debug_hlsl_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: Alexandre Julliard <julliard@winehq.org>
2021-02-16 15:59:59 +01:00
Zebediah Figura
61c3d802ed
vkd3d-shader: Avoid using debugging utilities in hlsl_debug_modifiers().
...
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-02-16 15:59:56 +01:00
Zebediah Figura
193218f54e
vkd3d-shader: Replace "parse_status" with a boolean variable.
...
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-16 15:59:44 +01:00
Zebediah Figura
3bf0e40b9d
vkd3d-shader: Use struct vkd3d_shader_location in struct hlsl_ctx.
...
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-12 21:01:40 +01:00
Zebediah Figura
3a975c2215
vkd3d-shader: Replace struct source_location with struct vkd3d_shader_location.
...
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-12 21:01:38 +01:00
Zebediah Figura
28b1d68ce3
vkd3d-shader: Separate hlsl_report_message() into helpers for individual log levels.
...
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-12 21:01:36 +01:00
Zebediah Figura
c7d4acaf4b
vkd3d-shader: Make the HLSL compiler reëntrant.
...
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-02-10 20:08:12 +01:00
Zebediah Figura
7400717282
vkd3d-shader: Move hlsl_ctx initialization and cleanup to hlsl_compile_shader().
...
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-02-10 20:08:06 +01:00
Zebediah Figura
3854991154
vkd3d-shader: Move parse_* structure definitions to hlsl.y.
...
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-02-10 20:08:04 +01:00