Commit Graph

116 Commits

Author SHA1 Message Date
Zebediah Figura f82b44748a d3dcompiler: Always set the matrix majority for declaration types.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-14 11:18:20 +02:00
Zebediah Figura d05ee3674e d3dcompiler: Check for multiple matrix majority keywords on typedefs.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-14 11:18:15 +02:00
Zebediah Figura 0340b0b044 d3dcompiler: Compute liveness ranges for anonymous nodes.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-01 20:58:38 +02:00
Zebediah Figura 2738e5d2b8 d3dcompiler: Compute liveness ranges for variables.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-01 20:58:36 +02:00
Zebediah Figura 443b0e3efd d3dcompiler: Index instructions for liveness ranges.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-01 20:58:30 +02:00
Zebediah Figura e0948524f2 d3dcompiler: Fix the location for a warning.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-24 19:43:38 +01:00
Zebediah Figura 8ea8eb20a4 d3dcompiler: Rename HLSL_MODIFIERS_COMPARISON_MASK to HLSL_MODIFIERS_MAJORITY_MASK and use it in more places.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-19 22:09:32 +01:00
Zebediah Figura f9ce3c7c7a d3dcompiler: Move modifer processing up out of the struct_spec rules.
So that storage classes will be stored in the relevant hlsl_ir_var instead of in
the type.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-19 22:09:32 +01:00
Zebediah Figura a82ec54862 d3dcompiler: Rename HLSL_MODIFIER_{IN, OUT} to HLSL_STORAGE_{IN, OUT}.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-19 22:09:32 +01:00
Zebediah Figura 756ed811c7 d3dcompiler: Apply type modifiers to the hlsl_type.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-13 20:09:30 +01:00
Zebediah Figura afd3a1e388 d3dcompiler: Fail if modifiers are applied to a function.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-13 20:09:30 +01:00
Zebediah Figura eb4fc30463 d3dcompiler: Don't add the default matrix majority attribute to variables.
This is a type modifier, and thus does not make a lot of sense on a variable.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-13 20:09:30 +01:00
Zebediah Figura 54387427b0 d3dcompiler: Separate out an hlsl_deref structure and store it in hlsl_ir_assignment directly.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-12 21:18:19 +01:00
Zebediah Figura 49f64d05f3 d3dcompiler: Don't pass a writemask to make_assignment().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-12 21:18:18 +01:00
Zebediah Figura 0e95c3faa2 d3dcompiler: Parse array types.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-12 21:18:18 +01:00
Zebediah Figura eb63713f60 d3dcompiler: Pass a struct source_location to create_loop().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-06 22:47:35 +01:00
Zebediah Figura 55a3fb90d0 d3dcompiler: Pass a struct source_location to check_invalid_matrix_modifiers().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-06 22:47:32 +01:00
Zebediah Figura 0d47e9bde4 d3dcompiler: Clarify error messages related to misplaced type modifiers.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-06 22:47:30 +01:00
Zebediah Figura 3048fb9064 d3dcompiler: Pass a struct source_location to add_func_parameter().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-06 22:47:27 +01:00
Zebediah Figura eef3e3dacd d3dcompiler: Pass a struct source_location to hlsl_report_message().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-06 22:47:25 +01:00
Zebediah Figura 77fe277a62 d3dcompiler: Return a struct source_location from set_location().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-06 22:47:22 +01:00
Zebediah Figura 1947f7fb80 d3dcompiler: Don't set the node type for return instructions.
Essentially just because it doesn't make sense to do so; a return instruction
is not an expression usable as a source to other instructions.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-03 14:20:26 +01:00
Zebediah Figura 09b2e42e92 d3dcompiler: Verify a returned value against the function's type and cast it if necessary.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-03 14:20:25 +01:00
Zebediah Figura e597b9e555 d3dcompiler: Parse return statements without a value.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-03 14:20:25 +01:00
Matteo Bruni 4e8ec8a6e0 d3dcompiler: Free variable definitions data on allocation errors.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-16 21:23:13 +01:00
Zebediah Figura 0778e81787 d3dcompiler: Parse the comma operator.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-16 20:48:30 +01:00
Zebediah Figura c5aa0feec7 d3dcompiler: Return an instruction list instead of a single instruction from nodes representing expressions.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-16 20:48:22 +01:00
Zebediah Figura bf31a900d1 d3dcompiler: Get rid of the "node" field from struct hlsl_ir_var.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-14 17:41:01 +02:00
Zebediah Figura 32fd9ff479 d3dcompiler: Get rid of the "node" field from struct hlsl_ir_function_decl.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-14 17:41:01 +02:00
Zebediah Figura cf5ccf29a9 d3dcompiler: Introduce a new_binary_expr() helper.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 01:26:41 +02:00
Zebediah Figura b899965615 d3dcompiler: Introduce a new_unary_expr() helper.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 01:26:41 +02:00
Zebediah Figura fbc9ff506c d3dcompiler: Parse initializer lists using a variable-size array.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 01:26:41 +02:00
Zebediah Figura cfa7f3a3f5 d3dcompiler: Use the documented YYABORT macro.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-13 01:26:41 +02:00
Zebediah Figura 79b7828894 d3dcompiler: Remove redundant components_count_expr_list() function.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-09 20:38:30 +02:00
Zebediah Figura c22f64bceb d3dcompiler: Store the arguments to a hlsl_ir_constructor as a fixed array.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-09 20:38:28 +02:00
Zebediah Figura f9f1e99099 d3dcompiler: Get rid of the superfluous "variable" rule.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-09 20:38:26 +02:00
Alexandre Julliard 43df1ed406 d3dcompiler: Make varargs functions WINAPIV.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47473
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-07 08:02:55 +02:00
Alexandre Julliard c8d34ef088 d3dcompiler: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-02 14:59:40 +02:00
Alexandre Julliard 2d27c13d5e d3dcompiler: Use %define parse.error verbose instead of %error-verbose.
The latter is deprecated and causes warnings.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-23 23:50:45 +02:00
Zebediah Figura 63d6dce047 d3dcompiler: Fix a buffer size computation.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-09 21:05:28 +02:00
Matteo Bruni bd7e83f292 d3dcompiler: Parse ": register()" syntax. 2015-06-19 19:11:03 +09:00
Henri Verbeet 307cf703af d3dcompiler: Free the filename if we don't store it in the HLSL preproc_directive rule (Valgrind). 2015-05-01 15:17:08 +09:00
Matteo Bruni c37714342e d3dcompiler: add_func_parameter is only used in hlsl.y. 2014-05-02 17:15:09 +02:00
Matteo Bruni d25486fba4 d3dcompiler: Pre/post increment/decrement operators are unary. 2014-05-02 17:15:05 +02:00
Matteo Bruni 89cac9c20d d3dcompiler: Remove a couple of noisy traces. 2014-05-02 17:15:02 +02:00
Henri Verbeet ffc01ec648 d3dcompiler: Make some string arrays const. 2014-05-02 13:45:43 +02:00
Matteo Bruni f6b22a7570 d3dcompiler: Put data type name of constants on the heap. 2012-11-09 16:43:12 +01:00
Matteo Bruni feda13db33 d3dcompiler: Skip stray semicolons outside of functions. 2012-11-09 16:43:09 +01:00
Matteo Bruni 0d2a27af40 d3dcompiler: Allow a comma at the end of an initializer. 2012-11-09 16:43:05 +01:00
Matteo Bruni 69922c671a d3dcompiler: Add some checks to function definitions. 2012-10-11 21:24:34 +02:00