Commit Graph

730 Commits

Author SHA1 Message Date
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
Victor Chiletto
5dbf859029 vkd3d-shader/hlsl: Parse SRV structured buffers. 2025-08-05 14:25:50 +02:00
Shaun Ren
f3dec58423 vkd3d-shader/hlsl: Ignore the 'groupshared' modifier for non-compute shaders. 2025-06-24 14:54:25 +02:00
Shaun Ren
4ede2f1365 vkd3d-shader/hlsl: Allow memory barriers in SM4+ target profiles. 2025-06-24 14:51:34 +02:00
Nikolay Sivov
f135f7fe07 vkd3d-shader/hlsl: Add a stub for the noise() intrinsic.
This function is used in tx_1_0 code, but is also supported in
fx_2_0 and fx_4_0 expressions.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2025-06-19 20:36:27 +02:00
Giovanni Mascellani
bda2be3423 vkd3d-shader/hlsl: Reject programs with group shared variables.
Currently the modifier is ignored and the program is miscompiled.
2025-06-05 15:50:04 +02:00
Elizabeth Figura
c1adf54a44 vkd3d-shader/hlsl: Forbid referring to typedefs with "struct". 2025-05-14 15:09:48 +02:00
Elizabeth Figura
5ad2e7ee6d vkd3d-shader/hlsl: Fix an incorrect error message for referring to non-struct types with "struct".
We cannot be redefining struct types in this rule, only referring to already
defined types. Struct type definition is handled by named_struct_spec, which
complains if the type was defined at all, regardless of class.
2025-05-14 15:08:13 +02:00
Elizabeth Figura
a06b9f6646 vkd3d-shader/hlsl: Do not emit HLSL_OP1_ABS for unsigned types. 2025-05-14 14:55:59 +02:00
Elizabeth Figura
cdc74a9377 vkd3d-shader/hlsl: Emit an error when min16uint is used in d3dbc target profiles.
Fixes: 18ca7affad
2025-05-14 14:12:19 +02:00
Elizabeth Figura
4a5411aa6e vkd3d-shader/hlsl: Return a uint1 from GetRenderTargetSampleCount(). 2025-05-12 15:29:23 +02:00
Francisco Casas
758a4bef09 vkd3d-shader/hlsl: Parse barriers.
And introduce hlsl_ir_sync to represent them.
2025-05-05 14:15:14 +02:00
Shaun Ren
8059608af9 vkd3d-shader/hlsl: Parse the RestartStrip() method for stream outputs. 2025-04-23 17:54:54 +02:00
Shaun Ren
9525eb2f0c vkd3d-shader/hlsl: Parse the Append() method for stream outputs. 2025-04-23 17:54:54 +02:00
Francisco Casas
9378d51b18 vkd3d-shader/hlsl: Remove the unnecessary "instr" field from the parser %union. 2025-04-16 16:22:42 +02:00
Francisco Casas
77941b131e vkd3d-shader/hlsl: Add switch_case destructors to the parser. 2025-04-16 16:21:51 +02:00
Francisco Casas
ff5f9cbcb6 vkd3d-shader/hlsl: Add parse_variable_def destructors to the parser. 2025-04-16 16:21:45 +02:00
Francisco Casas
f3ba7a84f4 vkd3d-shader/hlsl: Avoid leaking blocks on YYABORT.
Currently program errors might result on instructions that use
ctx->error_instr as src. In case we hit YYABORT while parsing another
part of the HLSL source, we have to make sure that the block that
contains the instruction is properly cleaned up, or we might hit the

    vkd3d:590273:err:hlsl_free_instr Failed assertion: list_empty(&node->uses)

assertion when hlsl_ctx_cleanup() is called after the YYABORT.

Consider the following shader:

    float4 main() : sv_target
    {
        // Statement A
        int p = foo;      // initializer argument is ERROR.
        // Statement B
        undeclared_fun(); // triggers YYABORT.
    }

Statement A will src the ctx->error_instr because of the undeclared
identifier and Statement B will trigger an YYABORT because of the
undeclared function.
2025-04-16 16:01:35 +02:00
Francisco Casas
128688a573 vkd3d-shader/hlsl: Avoid leaking declaration_statement blocks. 2025-04-16 16:00:18 +02:00
Francisco Casas
58706474ec vkd3d-shader/hlsl: Make struct_declaration_without_vars return void. 2025-04-16 15:58:40 +02:00
Francisco Casas
7b21059ee5 vkd3d-shader/hlsl: Support the .Length property for Textures.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57686
2025-04-14 15:47:16 +02:00