Commit Graph

519 Commits

Author SHA1 Message Date
Anna (navi) Figueiredo Gomes
dd3524444d vkd3d-shader/hlsl: Properly free default values when discarding them. 2025-11-17 15:17:45 +01:00
Elizabeth Figura
03d02f9018 vkd3d-shader/hlsl: Write the used sampler dimension for generic samplers in the CTAB. 2025-11-10 16:18:59 +01:00
Elizabeth Figura
bf702331d9 vkd3d-shader/hlsl: Use replace_ir() for hlsl_normalize_binary_exprs(). 2025-11-06 14:10:53 +01:00
Shaun Ren
200e66ba4f vkd3d-shader/hlsl: Store the flatten type in struct hlsl_ir_if. 2025-10-30 17:46:12 +01:00
Elizabeth Figura
1f40222a0d vkd3d-shader/hlsl: Use replace_ir() for hlsl_fold_constant_exprs(). 2025-10-28 16:30:49 +01:00
Elizabeth Figura
6e8eeb8f7a vkd3d-shader/hlsl: Use replace_ir() for hlsl_fold_constant_identities(). 2025-10-28 16:30:49 +01:00
Elizabeth Figura
bdb31a4983 vkd3d-shader/hlsl: Use replace_ir() for hlsl_fold_constant_swizzles(). 2025-10-28 16:30:49 +01:00
Elizabeth Figura
deb7a67d67 vkd3d-shader/hlsl: Introduce hlsl_block_add_constant(). 2025-10-28 16:30:49 +01:00
Elizabeth Figura
db41ba557b vkd3d-shader/hlsl: Create vsir descriptor info in hlsl_parse(). 2025-10-13 18:25:05 +02:00
Elizabeth Figura
be31842197 vkd3d-shader/hlsl: Return a node from lower_ir().
This allows us to use the same function for "folding" passes, which usually
replace with a node other than the last one added in a block.
2025-10-09 13:20:46 +02:00
Shaun Ren
44582a930c vkd3d-shader/hlsl: Handle the "_centroid" modifier suffix in semantic names. 2025-10-06 15:18:48 +02:00
Henri Verbeet
cb8c851bec vkd3d-shader/hlsl: Remove a hlsl_type_is_integer() prototype.
One should be plenty.
2025-09-22 11:37:54 +02:00
Petrichor Park
e35604dbf0 vkd3d-shader/hlsl: Implement the firstbitlow() intrinsic. 2025-09-22 11:26:42 +02:00
Petrichor Park
e6d840170d vkd3d-shader/hlsl: Implement the firstbithigh() intrinsic. 2025-09-22 11:26:42 +02:00
Petrichor Park
e49beca0d5 vkd3d-shader/hlsl: Implement the countbits() intrinsic. 2025-09-22 11:26:42 +02:00
Elizabeth Figura
a44d79a13c vkd3d-shader/hlsl: Use a simple counter for indexable temps. 2025-09-04 14:04:27 +02:00
Victor Chiletto
d5fdfa5f79 vkd3d-shader/hlsl: Emit RDEF metadata for SRV structured buffers. 2025-09-04 13:48:28 +02:00
Elizabeth Figura
25ae2fcc84 vkd3d-shader/hlsl: Use unique temps for non-indexable variables. 2025-09-02 11:33:25 +02:00
Shaun Ren
320c3c9652 vkd3d-shader/hlsl: Fold some general conditional identities.
The following conditional identities are applied:

  c ? x : x -> x
  false ? x : y -> y; true ? x : y -> x
  c ? true : false -> c; c ? false : true -> !c
  !c ? x : y -> c ? y : x

Lastly, for expression chains x, y in a conditional expression
  c ? x : y,
we evaluate all conditionals in the expression chains with the
condition c, assuming c is true (for x), or false (for y).
2025-08-21 16:00:51 +02:00
Shaun Ren
245430002a vkd3d-shader/hlsl: Fold some general unary identities.
The following unary identities are applied:

  ||x|| -> |x|
  |-x| -> |x|
  ~(~x) -> x
  f(g(x)) -> g(x), where f(), g() are floor() or ceil() functions.
  -(-x) -> x
  !!x -> x
  !(x == y) -> x != y, !(x < y) -> x >= y, etc (for integers).
2025-08-21 16:00:46 +02:00
Henri Verbeet
e7be5aa9fd vkd3d-shader/hlsl: Pass a vkd3d_shader_source_list pointer to hlsl_ctx_init().
Instead of storing the list inside struct hlsl_ctx. The source file
names in the list are used by the location information that the HLSL
frontend produces, and end up being referenced by the vsir program. If
we want the vsir program to be able to outlive the hlsl_ctx, its
location information can't reference data owned by the hlsl_ctx.
2025-08-07 20:33:24 +02:00
Henri Verbeet
7c37fc6a8b vkd3d-shader: Introduce struct vkd3d_shader_source_list. 2025-08-07 20:33:24 +02:00
Shaun Ren
4bb880f9ed vkd3d-shader/hlsl: Support interlocked operations on non-indexed groupshared variables. 2025-08-05 16:33:08 +02:00
Shaun Ren
8d0d8d106b vkd3d-shader/hlsl: Support stores to raw groupshared variables. 2025-08-05 16:32:34 +02:00
Shaun Ren
3802344e97 vkd3d-shader/hlsl: Allocate groupshared registers. 2025-08-05 16:06:07 +02:00