Commit Graph

5442 Commits

Author SHA1 Message Date
Giovanni Mascellani
be94a37e23 vkd3d-shader/ir: Validate descriptor resource data types in vsir programs. 2025-04-16 15:52:46 +02:00
Giovanni Mascellani
01f47e00f2 vkd3d-shader/ir: Validate descriptor resource types in vsir programs. 2025-04-16 15:49:32 +02:00
Giovanni Mascellani
0da80c1f25 vkd3d-shader/ir: Validate descriptor types in vsir programs. 2025-04-16 15:46:20 +02:00
Giovanni Mascellani
869e6ef583 vkd3d-shader: Describe the resource data types of samplers as NONE.
It used to be UINT before, but it doesn't make any sense.
2025-04-16 15:42:31 +02:00
Giovanni Mascellani
f02ea94c42 vkd3d-shader/d3d-asm: Trace register names for I/O declarations. 2025-04-14 21:57:27 +02:00
Giovanni Mascellani
0417f4f162 vkd3d-shader/d3d-asm: Include the program descriptors when tracing vsir code. 2025-04-14 21:57:15 +02:00
Giovanni Mascellani
bac6949365 vkd3d-shader/d3d-asm: Expose the raw value if unknown in shader_dump_data_type(). 2025-04-14 21:55:26 +02:00
Giovanni Mascellani
fd16bba29d vkd3d-shader/d3d-asm: Expose the raw value if unknown in shader_dump_resource_type(). 2025-04-14 21:55:26 +02:00
Henri Verbeet
f4e10ea9d5 vkd3d-shader/d3d-asm: Include the I/O signatures when tracing vsir code. 2025-04-14 21:55:26 +02:00
Giovanni Mascellani
24e61cf74e vkd3d-shader: Represent resource data types as vkd3d_data_type in struct vkd3d_shader_descriptor_info1. 2025-04-14 21:55:26 +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
Elizabeth Figura
0c18736370 vkd3d-shader/ir: Validate SSA write masks. 2025-04-14 15:32:15 +02:00
Elizabeth Figura
d91d552a5e vkd3d-shader/ir: Introduce a vsir_dst_param_init_null() helper. 2025-04-14 15:32:12 +02:00
Elizabeth Figura
1a1f1f1369 vkd3d-shader/hlsl: Set the right interpolation mode in the vsir signature. 2025-04-14 15:29:19 +02:00
Elizabeth Figura
7331c70e9e vkd3d-shader/hlsl: Set the sysval for more sm1 semantics.
To match the sysval we set when reading them.
2025-04-14 15:29:19 +02:00
Feifan He
ba7a9a0b29 vkd3d-shader/msl: Implement VKD3DSIH_LD.
Co-authored-by: Giovanni Mascellani <gmascellani@codeweavers.com>
2025-04-14 15:27:02 +02:00
Giovanni Mascellani
3493688a4d vkd3d-shader/msl: Access descriptors with a type-erased array.
Currently a descriptor set is represented with a structure
whose fields are the various descriptors that the shader is
going to use, each of them qualified with its type. This model
doesn't match very well what happens with D3D12 and with Vulkan
and descriptor indexing and mutable descriptors, where many
descriptor of different types can overlap, and only at shader
runtime it is decided which of them must be used.

Therefore with this patch a descriptor is represented as a
structure whose fields carry no intrinsic typing information,
but are reinterpreted according to the shader behavior on
each access. For the moment there is just one field, but more
will be added to account for fancier descriptor types and
to workaround Metal limitations.

When completed, this design will be similar in spirit to what
the Metal shader converter does, with little technical
differences.

This choice has a couple of drawbacks:

 1. shader debugging with Xcode is less comfortable, because
    the shader doesn't carry static descriptor typing
    information and Xcode is therefore less able to provide
    useful context;

 2. it requires tier 2 argument buffer support and macOS
    version >= 13, which includes guarantees on the runtime
    layout for descriptors.

Supporting descriptor indexing and mutable descriptors is
considered to be worthy of those drawbacks, though, is
effectively required by many applications and appears to be
the first goal we should aim for. If needed, in the future
we might also add support for older hardware, at least for
shaders that do not make use of advanced features.
2025-04-14 14:45:14 +02:00
Giovanni Mascellani
7fb288819a vkd3d-shader/msl: Set the prefix to "unknown" for unhandled shader types in msl_generator_init().
Like we do for GLSL; there's no reason to abort compilation here. Note
that this also avoids leaking "gen->buffer" and "gen->string_buffers" on
the error path.
2025-04-09 16:08:15 +02:00
Shaun Ren
0c139ef7a0 vkd3d-shader/hlsl: Add special allocation rules for patch constant data. 2025-04-09 16:02:12 +02:00
Shaun Ren
d3b32fefa3 vkd3d-shader/tpf: Support SV_RenderTargetArrayIndex/SV_ViewportArrayIndex sysvals in tessellation shaders. 2025-04-09 16:02:12 +02:00
Shaun Ren
05f8dd8273 vkd3d-shader/hlsl: Prioritize smaller writemasks for all allocators in allocate_semantic_registers(). 2025-04-09 16:02:12 +02:00
Shaun Ren
ec2f18ab17 vkd3d-shader/hlsl: Free all allocators in allocate_semantic_registers(). 2025-04-09 16:02:12 +02:00
Shaun Ren
d1df10ac86 vkd3d-shader/hlsl: Use dcl_output_siv for patch constant function sysval outputs. 2025-04-09 16:02:12 +02:00
Anna (navi) Figueiredo Gomes
3e8b56c509 vkd3d-shader/fx: Don't cast between int and uint in state blocks. 2025-04-08 19:14:15 +02:00
Elizabeth Figura
f576ecc992 vkd3d-shader/hlsl: Introduce a compiler pass to vectorize stores. 2025-04-03 20:29:20 +02:00