Commit Graph

613 Commits

Author SHA1 Message Date
Elizabeth Figura
eeb7bbe3c5 vkd3d-shader/hlsl: Handle error expressions in ternary expressions. 2024-10-17 17:28:52 +02:00
Elizabeth Figura
d95962068a vkd3d-shader/hlsl: Handle error expressions in initializers. 2024-10-17 17:28:52 +02:00
Elizabeth Figura
dfe79cb6a9 vkd3d-shader/hlsl: Factor the component count check into initialize_var(). 2024-10-17 17:28:52 +02:00
Elizabeth Figura
d8892a4ca2 vkd3d-shader/hlsl: Store the initializer location in struct parse_initializer. 2024-10-17 17:28:52 +02:00
Elizabeth Figura
44ea7b5e12 vkd3d-shader/hlsl: Factor out an initialize_var() helper. 2024-10-17 17:28:52 +02:00
Shaun Ren
069b8aac64 vkd3d-shader/hlsl: Implement struct single inheritance.
Here, we implement single inheritance by inserting a field at the
beginning of the derived struct with name "$super".

For the following struct declarations

  struct a
  {
      float4 aa;
      float4 bb;
  };

  struct b : a
  {
      float4 cc;
  };

  struct c : b
  {
      float4 bb;
  };

this commit generates the following:

  struct a
  {
      float4 aa;
      float4 bb;
  };

  struct b
  {
      struct a $super;
      float4 cc;
  };

  struct c
  {
      struct b $super;
      float4 bb;
  };
2024-10-16 21:07:53 +02:00
Nikolay Sivov
5fb3a91276 vkd3d-shader/hlsl: Implement the modf() intrinsic.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-15 16:43:33 +02:00
Elizabeth Figura
34fdb304bb vkd3d-shader/hlsl: Handle error expressions in increments. 2024-10-07 17:33:07 +02:00
Elizabeth Figura
84685fb56d vkd3d-shader/hlsl: Handle error expressions in subscripts. 2024-10-07 17:33:07 +02:00
Elizabeth Figura
c66f25016b vkd3d-shader/hlsl: Handle error expressions in array indexes. 2024-10-07 17:33:07 +02:00
Elizabeth Figura
41ff4343e1 vkd3d-shader/hlsl: Handle error expressions in explicit casts. 2024-10-07 17:33:07 +02:00
Elizabeth Figura
10efdd3f63 vkd3d-shader/hlsl: Introduce an add_explicit_conversion() helper. 2024-10-07 17:33:07 +02:00
Francisco Casas
0b989c9f37 vkd3d-shader/hlsl: Fix the conditions to discard default values.
Otherwise default_values for strings are lost.

Thanks to Nikolay Sivov for pointing this out.
2024-10-07 17:28:07 +02:00
Elizabeth Figura
cebe0a8b95 vkd3d-shader/hlsl: Handle error expressions in method calls. 2024-10-03 17:47:26 +02:00
Elizabeth Figura
600f90e8b0 vkd3d-shader/hlsl: Handle error expressions in assignments. 2024-10-03 17:47:26 +02:00
Elizabeth Figura
c94aa5e03c vkd3d-shader/hlsl: Handle error expressions in binary expressions. 2024-10-03 17:47:26 +02:00
Elizabeth Figura
d6052bc31b vkd3d-shader/hlsl: Handle error expressions in function calls. 2024-10-03 17:47:26 +02:00
Elizabeth Figura
5d52bef19d vkd3d-shader/hlsl: Return an "error" expression when using an undeclared variable. 2024-10-03 17:47:26 +02:00
Francisco Casas
caa2a9d314 vkd3d-shader/hlsl: Parse sampler_state. 2024-10-02 22:07:34 +02:00
Francisco Casas
f47d523e0b vkd3d-shader/hlsl: Process 'texture' as a valid stateblock lhs. 2024-10-02 22:07:34 +02:00
Nikolay Sivov
2722346ffb vkd3d-shader/hlsl: Do not lower index expressions for effects.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-02 22:05:24 +02:00
Nikolay Sivov
5e52ccbf3d vkd3d-shader/hlsl: Move default values indexing fixup to the tpf writer stage.
The primary goal here is to move compilation profile type and version
check outside of a parsing stage. Default values for parameters were
never subjected to this fixup, and it does look tpf-specific, so moving
it where it belongs.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-01 17:27:12 +02:00
Elizabeth Figura
650bf4d83f vkd3d-shader/hlsl: Fix a corner case in ternary type conversion.
If the condition and argument types are compatible, i.e. there is no broadcast,
the resulting shape should be the shape of the arguments, not the shape of the
condition.
2024-09-23 15:43:15 +02:00
Elizabeth Figura
b2cddecfc5 vkd3d-shader/hlsl: Use add_cast() in append_conditional_break().
Instead of creating a cast node directly.

This specifically handles the 1x1 matrix case, which currently the backend code does not expect.
2024-09-23 15:43:15 +02:00
Elizabeth Figura
43b714d896 vkd3d-shader/hlsl: Handle error expressions in unary expressions. 2024-09-23 15:28:47 +02:00
Elizabeth Figura
7e3231c749 vkd3d-shader/hlsl: Return an "error" expression when constructing an arithmetic expression from incompatible types. 2024-09-23 15:28:47 +02:00
Elizabeth Figura
f73a23f735 vkd3d-shader/hlsl: Do not create a copy in add_assignment(). 2024-09-23 15:28:47 +02:00
Elizabeth Figura
eb7f5f7f68 vkd3d-shader/hlsl: Return bool from add_assignment(). 2024-09-23 15:28:47 +02:00
Elizabeth Figura
8975933aff vkd3d-shader/hlsl: Store a pointer to the block's "value" instruction in the block. 2024-09-23 15:28:47 +02:00
Nikolay Sivov
d7def84253 vkd3d-shader/hlsl: Remove the 'double' keyword.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-09-23 15:26:35 +02:00
Francisco Casas
b72ef6038d vkd3d-shader/hlsl: Remove hlsl_ir_vsir_instruction_ref. 2024-09-14 16:39:17 +02:00
Francisco Casas
ffc1449412 vkd3d-shader/hlsl: Allow effect calls on default value initializers. 2024-09-14 16:09:12 +02:00
Francisco Casas
4aa262d773 vkd3d-shader/hlsl: Parse ConstructGSWithSO(). 2024-09-14 16:09:08 +02:00
Francisco Casas
1f9fc2a422 vkd3d-shader/hlsl: Process GeometryShader as a valid stateblock lhs. 2024-09-14 16:02:43 +02:00
Francisco Casas
02b249d5e7 vkd3d-shader/hlsl: Introduce enum hlsl_compile_type. 2024-09-14 15:57:40 +02:00
Elizabeth Figura
1aa857735f vkd3d-shader/hlsl: Preserve doubles in intrinsic_determinant(). 2024-09-12 18:48:52 +02:00
Elizabeth Figura
e146cc4c8e vkd3d-shader/hlsl: Preserve doubles in intrinsic_cross(). 2024-09-12 18:48:52 +02:00
Elizabeth Figura
1176aaad22 vkd3d-shader/hlsl: Preserve doubles in elementwise_intrinsic_float_convert_args(). 2024-09-12 18:48:52 +02:00
Elizabeth Figura
ebaf877b62 vkd3d-shader/hlsl: Preserve doubles in intrinsic_float_convert_arg(). 2024-09-12 18:48:52 +02:00
Elizabeth Figura
534d546ed9 vkd3d-shader/hlsl: Use expr_common_base_type() in intrinsic_cross(). 2024-09-12 18:48:52 +02:00
Elizabeth Figura
9260078300 vkd3d-shader/hlsl: Use intrinsic_float_convert_arg() in write_acos_or_asin(). 2024-09-12 18:48:52 +02:00
Elizabeth Figura
82773eb805 vkd3d-shader/hlsl: Use elementwise_intrinsic_float_convert_args() in refract(). 2024-09-11 15:11:42 +02:00
Elizabeth Figura
2688a24bde vkd3d-shader/hlsl: Preserve halves in intrinsic_step(). 2024-09-11 15:11:42 +02:00
Elizabeth Figura
b23c172a47 vkd3d-shader/hlsl: Use elementwise_intrinsic_float_convert_args() in intrinsic_smoothstep(). 2024-09-11 15:11:42 +02:00
Elizabeth Figura
e7eadb38b8 vkd3d-shader/hlsl: Use elementwise_intrinsic_float_convert_args() in intrinsic_faceforward(). 2024-09-11 15:11:42 +02:00
Elizabeth Figura
24e29649c4 vkd3d-shader/hlsl: Use elementwise_intrinsic_convert_args() in intrinsic_dst().
This one preserves integer arguments.
2024-09-11 15:11:42 +02:00
Elizabeth Figura
7636f2a233 vkd3d-shader/hlsl: Use elementwise_intrinsic_float_convert_args() in write_atan_or_atan2(). 2024-09-11 15:11:42 +02:00
Nikolay Sivov
de6abd964e vkd3d-shader/hlsl: Implement the mad() intrinsic.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-09-10 21:40:32 +02:00
Shaun Ren
73ee5a135a vkd3d-shader/hlsl: Check for duplicate attributes in function declaration. 2024-09-04 18:18:23 +02:00
Petrichor Park
855b9713b8 vkd3d-shader/hlsl: Implement the sincos() intrinsic. 2024-09-04 18:16:37 +02:00