Commit Graph

4943 Commits

Author SHA1 Message Date
Henri Verbeet
cfe9cd3794 Release 1.18. 2025-11-20 11:36:06 +01:00
Francisco Casas
5fe8a0c70f vkd3d-shader/hlsl: Retrieve error_instr instead of NULL in hlsl_block_add_resource_load().
Fixes: 06a503975f
2025-11-20 11:31:00 +01:00
Francisco Casas
06a503975f vkd3d-shader/hlsl: Avoid member access on NULL resource load (ubsan).
In some scenarios this resource load is NULL, and we are still doing
&load->node on it.

    vkd3d/libs/vkd3d-shader/hlsl.c:2195:12: runtime error: member access
            within null pointer of type 'struct hlsl_ir_resource_load'

This happens in tests/hlsl/sampler-state.shader_test, in the following
test:

    [pixel shader fail]
    Texture2D tex;

    float4 main(): sv_target
    {
        return tex.Sample(sampler_state {}, float2(0, 0));
    }
2025-11-18 17:42:11 +01:00
Anna (navi) Figueiredo Gomes
dd3524444d vkd3d-shader/hlsl: Properly free default values when discarding them. 2025-11-17 15:17:45 +01:00
Giovanni Mascellani
7f377879fc vkd3d-shader/spirv: Clamp push constant CBV sizes to those of the push constant ranges backing them.
Otherwise invalid SPIR-V may be generated, because the CBV field in
"push_cb_struct" may end up overlapping with a subsequent one.
2025-11-12 15:24:30 +01:00
Henri Verbeet
4039168bca vkd3d-shader/hlsl: Consider scalars to be equivalent to 1-component vectors in hlsl_add_conditional(). 2025-11-12 15:12:30 +01:00
Henri Verbeet
5d385fbce0 vkd3d-shader/d3d-asm: Avoid shader_print_data_type() in shader_dump_resource_data_type(). 2025-11-12 15:11:10 +01:00
Giovanni Mascellani
065430547c vkd3d-shader/dxil: Parse the gather offset as an int2.
Instead of an int3.

Gather operations expect an offset with only two components.
Currently the following field (which is the gather channel) is
parsed as a third component, which leads to wrong and invalid
results.

This fixes a crash on a shader from WRC Generations.
2025-11-12 15:08:42 +01:00
Henri Verbeet
cb3367c66d vkd3d-common: Get rid of "vkd3d_dbg_env_name". 2025-11-12 15:06:42 +01:00
Elizabeth Figura
1569bb3fb8 vkd3d-shader/hlsl: Only prepend a $ for parameters with the uniform keyword. 2025-11-10 16:20:08 +01:00
Elizabeth Figura
6801f50422 vkd3d-shader/hlsl: Write a "dimx" of 4 for combined sampler types in the CTAB. 2025-11-10 16:20:01 +01:00
Elizabeth Figura
da456b1fb4 vkd3d-shader/hlsl: Do not deduplicate sampler types in the CTAB. 2025-11-10 16:18:59 +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
Francisco Casas
460abeb03e vkd3d-shader/ir: Make FOG and PSIZE write masks 0x1 on I/O normalization.
The validator checks that on normalized vsir I/O destination write masks
are always a subset of the element's write mask.

This is currently not always happening for FOG and PSIZE outputs, because
d3dbc input might use the 0xf mask instead, despite these semantics being
scalar.

Note that this problem is hidden when using varying mapping, because in
that case the vsir_program_remap_output_signature() pass, specifically
the remove_unread_output_components() function, fixes the write mask.
2025-11-10 16:15:55 +01:00
Francisco Casas
6ca05f458e vkd3d-shader/hlsl: Actually emit 0xf write masks for FOG and PSIZE destination operands. 2025-11-10 15:54:59 +01:00
Shaun Ren
58d02da892 vkd3d-shader/hlsl: Use a bool type for "new_cond" in lower_conditional_block_discard_nz().
This fixes the assertion error

    "sm4_generate_vsir_instr_expr Failed assertion: dst_type->e.numeric.type == HLSL_TYPE_BOOL"

which occurs when compiling the following HLSL shader using the ps_4_0 target profile:

    uniform float4 x;
    uniform bool b;

    float4 main() : SV_Target
    {
        if (!b)
            clip(x.x);
        else
            clip(x.y);

        return x;
    }
2025-11-10 15:51:26 +01:00
Elizabeth Figura
67d391fad8 vkd3d-shader/hlsl: Use replace_ir() for lower_discard_nz(). 2025-11-06 15:59:50 +01:00
Elizabeth Figura
88b218cae1 vkd3d-shader/hlsl: Use replace_ir() for lower_resource_load_bias(). 2025-11-06 15:59:01 +01:00
Elizabeth Figura
bf702331d9 vkd3d-shader/hlsl: Use replace_ir() for hlsl_normalize_binary_exprs(). 2025-11-06 14:10:53 +01:00
Elizabeth Figura
974db85d07 vkd3d-shader/hlsl: Use replace_ir() for fold_unary_identities(). 2025-11-06 14:10:53 +01:00
Henri Verbeet
74ebd4621f vkd3d-shader/msl: Implement VSIR_OP_FIRSTBIT_HI. 2025-11-04 14:59:38 +01:00
Henri Verbeet
c576a09d57 vkd3d-shader/msl: Implement VSIR_OP_FIRSTBIT_LO. 2025-11-04 14:59:38 +01:00
Henri Verbeet
08026880d6 vkd3d-shader/msl: Implement VSIR_OP_COUNTBITS. 2025-11-04 14:59:38 +01:00
Henri Verbeet
f431cddc9f vkd3d-shader/msl: Implement support for VKD3DSPR_IMMCONSTBUFFER registers. 2025-11-04 14:59:38 +01:00
Henri Verbeet
51cce61770 vkd3d-shader/msl: Implement VSIR_OP_SYNC. 2025-11-04 14:59:38 +01:00