Commit Graph

8427 Commits

Author SHA1 Message Date
Conor McCarthy
f9d12e5596 tests/hlsl: Add a precise MAD test where the first component is not x. 2025-10-15 12:41:49 +02:00
Henri Verbeet
a2ce610cc9 vkd3d-shader/glsl: Handle VSIR_DATA_SNORM and VSIR_DATA_UNORM in shader_glsl_vprint_assignment(). 2025-10-15 12:41:49 +02:00
Conor McCarthy
3943f9aca6 vkd3d-shader/spirv: Handle VSIR_DATA_SNORM and VSIR_DATA_UNORM in image_format_for_image_read().
Typed UAVs can be declared snorm or unorm.
2025-10-15 12:41:49 +02:00
Conor McCarthy
1586c2294a vkd3d-shader/spirv: Handle VSIR_DATA_SNORM and VSIR_DATA_UNORM in spirv_get_type_id(). 2025-10-15 12:41:49 +02:00
Henri Verbeet
f02c0e9be8 tests/hlsl: Add tests for unorm and snorm buffer SRVs. 2025-10-15 12:41:49 +02:00
Henri Verbeet
808191eb8e vkd3d-shader/spirv: Emit an error for unhandled types in spirv_get_type_id(). 2025-10-15 12:41:49 +02:00
Giovanni Mascellani
40bdaa43af vkd3d: Do not put immutable samplers in the push descriptor set.
This was the original intention, but it didn't happen because of a bug:
what we need to know at this point is whether the push descriptor set is
being used in general (which is tracked by the corresponding Vulkan
extension bit), not whether the descriptors we're currently processing
are to be put in the push descriptor set (which is tracked by
`push_descriptor'). Indeed, `push_descriptor' is always false when
processing static samplers, precisely because we want to segregate them
in different sets.

This fixes a rendering bug in "The Dark Pictures Anthology: Man of
Medan".

Fixes: 07b7975d09
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58589
2025-10-14 16:23:07 +02:00
Giovanni Mascellani
8b8ee542d7 vkd3d-shader/ir: Lower SATURATE modifiers to instructions. 2025-10-14 16:21:05 +02:00
Giovanni Mascellani
835044dd8e vkd3d-shader/ir: Introduce VSIR_OP_SATURATE to represent floating-point clamping to [0, 1]. 2025-10-14 15:53:26 +02:00
Henri Verbeet
9b98761909 vkd3d-shader/msl: Implement VSIR_OP_IREM. 2025-10-14 15:49:18 +02:00
Henri Verbeet
c89fd93859 vkd3d-shader/ir: Require signed operands for IREM instructions. 2025-10-14 15:49:18 +02:00
Henri Verbeet
b6acac49f1 vkd3d-shader/msl: Implement VSIR_OP_UREM. 2025-10-14 15:49:18 +02:00
Henri Verbeet
69879129f8 vkd3d-shader/msl: Implement VSIR_OP_IDIV. 2025-10-14 15:49:18 +02:00
Henri Verbeet
320bdd6759 vkd3d-shader/ir: Validate IDIV instructions. 2025-10-14 15:49:18 +02:00
Henri Verbeet
90758b7ca8 vkd3d-shader/msl: Implement VSIR_OP_UDIV_SIMPLE. 2025-10-14 15:49:18 +02:00
Henri Verbeet
11e5b83e79 vkd3d-shader/spirv: Handle VSIR_DATA_MIXED in spirv_get_type_id().
For example, a HLSL shader like this:

    tbuffer t0
    {
        float4 data;
    };

    float4 main() : sv_target
    {
        return data;
    }

would be compiled to the following:

    ps_4_0
    dcl_resource_buffer (mixed,mixed,mixed,mixed) t0
    dcl_output o0.xyzw
    dcl_temps 1
    ld r0.xyzw, l(0, 0, 0, 0), t0.xyzw
    mov o0.xyzw, r0.xyzw
    ret

VSIR_DATA_MIXED used to be mapped to VKD3D_SHADER_COMPONENT_UINT by
vkd3d_component_type_from_data_type(), but we no longer use that.
Found by Giovanni Mascellani.
2025-10-14 15:48:36 +02:00
Anna (navi) Figueiredo Gomes
c73afe94f1 vkd3d-shader/hlsl: Remove the duplicate HLSL_IR_STRING_CONSTANT branch from evaluate_static_expression(). 2025-10-14 15:47:05 +02:00
Francisco Casas
7b017d933b vkd3d-shader: Update the vsir_program_iterator_insert_before() comment.
"ins_it" is not really optional.
2025-10-14 15:45:30 +02:00
Giovanni Mascellani
b5b5c67b34 vkd3d-shader/ir: Lower ABSNEG modifiers to instructions. 2025-10-13 19:25:51 +02:00
Giovanni Mascellani
968eb7467c vkd3d-shader/ir: Use VSIR_OP_NEG in insert_fragment_fog_before_ret(), in the common part.
The NEG source modifier is not generated any more during vsir
transformation, so it can be dropped in backends.
2025-10-13 19:13:05 +02:00
Giovanni Mascellani
ca23db5bae vkd3d-shader/ir: Use VSIR_OP_NEG in insert_fragment_fog_before_ret(), in the doubly exponential case. 2025-10-13 19:13:01 +02:00
Giovanni Mascellani
b2d47693b4 vkd3d-shader/ir: Use VSIR_OP_NEG in insert_fragment_fog_before_ret(), in the exponential case. 2025-10-13 19:12:56 +02:00
Giovanni Mascellani
786ffe69f7 vkd3d-shader/ir: Use VSIR_OP_NEG in insert_fragment_fog_before_ret(), in the linear case. 2025-10-13 19:12:51 +02:00
Giovanni Mascellani
eb1210f517 vkd3d-shader/ir: Lower NEG modifiers to instructions. 2025-10-13 19:07:01 +02:00
Giovanni Mascellani
79736ae6ff vkd3d-shader/ir: Introduce VSIR_OP_NEG to represent floating-point negation. 2025-10-13 19:06:34 +02:00