Giovanni Mascellani
172e7edf2d
vkd3d-shader: Refactor common code for vkd3d_shader_compile().
2024-03-08 23:35:54 +01:00
Giovanni Mascellani
0e5d6a97cc
vkd3d-shader: Refactor common code for vkd3d_shader_scan().
2024-03-08 23:35:54 +01:00
Giovanni Mascellani
bbd37a76fc
vkd3d-shader: Treat the HLSL case specially in vkd3d_shader_compile().
2024-03-08 23:35:54 +01:00
Giovanni Mascellani
3a1c32acd4
vkd3d-shader: Treat the HLSL case specially in vkd3d_shader_scan().
...
The other cases are similar and common code can be refactored.
Ideally the HLSL parser will eventually fit the same model, but that
will require more extensive work.
2024-03-08 23:35:53 +01:00
Giovanni Mascellani
9aa86901e3
vkd3d-shader/d3d-asm: Support emitting the shader signature.
2024-03-07 23:08:24 +01:00
Giovanni Mascellani
9d99389663
vkd3d-shader/d3d-asm: Describe the ASM dialect with a bunch of flags instead of a plain enum.
2024-03-07 23:08:22 +01:00
Giovanni Mascellani
94d641783b
vkd3d-shader/d3d-asm: Do not make a copy of the buffer before returning it.
2024-03-07 23:08:20 +01:00
Giovanni Mascellani
9c678532a7
vkd3d-shader/ir: Dump the domination relationship.
2024-02-22 22:45:16 +01:00
Nikolay Sivov
656c068b32
vkd3d-shader/fx: Do not align strings for fx_4/fx_5 profiles.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-02-19 21:12:07 +01:00
Conor McCarthy
6e634ad690
vkd3d-shader: Raise the instruction parameter allocation size if necessary.
...
Monolithic switch instructions have no definite case count limit.
2024-02-14 21:48:38 +01:00
Henri Verbeet
ced8543952
vkd3d-shader: Use vkd3d_atomic_increment_u32() in vkd3d_shader_dump_blob().
2024-02-01 00:08:18 +01:00
Henri Verbeet
fee3b94563
vkd3d-shader: Start an if-block on VKD3DSIH_IFC in vkd3d_shader_scan_instruction().
2024-01-25 22:24:50 +01:00
Conor McCarthy
adfbecef3c
vkd3d-shader/spirv: Handle globally coherent UAVs.
2024-01-25 22:24:20 +01:00
Francisco Casas
b92f6c448a
vkd3d-shader/ir: Lower texkill instructions to discard_nz.
2024-01-24 22:37:41 +01:00
Henri Verbeet
23dcd4f22b
vkd3d-shader/ir: Store the shader version in struct vsir_program.
2024-01-22 22:18:50 +01:00
Henri Verbeet
fc9043be3c
vkd3d-shader/ir: Introduce struct vsir_program.
2024-01-22 22:18:48 +01:00
Nikolay Sivov
a0207436f2
vkd3d-shader/tpf: Add initial support for writing fx_4_0/fx_4_1 binaries.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:48 +01:00
Nikolay Sivov
9494b72224
vkd3d-shader: Add separate binary target type for effects.
...
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-01-11 23:04:48 +01:00
Giovanni Mascellani
a02cd1cf64
vkd3d-shader/dxil: Do not use the parser before it is initialized.
2024-01-03 22:38:24 +01:00
Zebediah Figura
4ff389854c
vkd3d-shader: Allow compiling d3d bytecode to SPIR-V.
2023-12-14 23:19:31 +01:00
Zebediah Figura
2bc40385d9
vkd3d-shader: Do not scan DCL instructions which do not declare resources.
2023-12-14 23:19:28 +01:00
Zebediah Figura
8af47a96ea
vkd3d-shader: Do not scan the shader in vkd3d_shader_parser_compile() for assembly targets.
2023-12-14 23:19:28 +01:00
Giovanni Mascellani
1015cc952e
vkd3d-shader/d3d-asm: Add an "internal" mode for the ASM dumper.
...
The new mode exposes more details about what's going on inside the VSIR
code and it's meant to ease development and debugging.
2023-12-12 23:16:26 +01:00
Zebediah Figura
28f32349f4
vkd3d-shader: Add a helper to search the scan descriptor info.
...
Avoid shadowing "info" in vkd3d_shader_scan_combined_sampler_declaration().
2023-12-07 21:57:34 +01:00
Conor McCarthy
f2a656b876
vkd3d-shader/dxil: Introduce a value type for immediate constant buffers.
2023-11-22 22:07:56 +01:00
Henri Verbeet
ae4341b565
vkd3d-shader/ir: Use location information from the instruction in vkd3d_shader_scan_instruction().
2023-11-21 22:41:58 +01:00
Henri Verbeet
01dad41862
vkd3d-shader/ir: Skip recording combined resource/sampler information for dynamically indexed descriptor arrays.
...
And output a warning instead.
2023-11-21 22:41:57 +01:00
Henri Verbeet
5b82afb83f
vkd3d-shader/ir: Decorate vkd3d_shader_scan_error() with VKD3D_PRINTF_FUNC.
2023-11-21 22:41:55 +01:00
Henri Verbeet
9de793f180
vkd3d-shader: Implement scanning combined resource/sampler information.
2023-11-13 23:19:23 +01:00
Giovanni Mascellani
dd96fe50e2
vkd3d-shader: Dump shaders as soon as possible.
...
So that they are dumped even if parsing fails, which is a circumstance
in which one likely wants to see the problematic shader.
The downside of that is that for shader types other than HLSL
the profile is not written any more in the filename. This should
not be a big problem, because in those cases the shader describes
its own type.
When dumping an HLSL shader, the id is brought in front of the profile
in the file name, in order to make it more tab-friendly: when dealing
with a directory full of shaders it's likely that the id determines
the profile, but the other way around.
2023-11-02 18:22:26 +01:00
Giovanni Mascellani
ab09c0b45b
vkd3d-shader: Expose the whole profile when dumping an HLSL shader.
...
The profile cannot be reliably devised by analyzing the HLSL code,
so it's useful to have it included in the file name.
2023-11-02 18:22:24 +01:00
Zebediah Figura
a668f1ce1c
vkd3d-shader: Handle a NULL descriptor info in vkd3d_shader_scan_add_descriptor().
2023-10-31 21:59:33 +01:00
Conor McCarthy
1e5f91b371
vkd3d-shader: Emit IR CBV declaration sizes in bytes.
...
DXIL declares CBV sizes in bytes and they are not aligned to 16 bytes.
2023-10-19 23:07:43 +02:00
Conor McCarthy
df4e1b7393
vkd3d-shader/dxil: Read immediate constant arrays.
2023-10-11 22:21:19 +02:00
Zebediah Figura
bd9eae6c22
vkd3d-shader: Scan combined sampler declarations.
...
This does not handle 1.x samplers yet.
2023-10-09 21:58:38 +02:00
Conor McCarthy
b765f3c770
vkd3d-shader: Make the paramater allocator slab size at least MAX_REG_OUTPUT.
...
The allocator is used for DXIL input/output parameter arrays.
2023-09-25 22:07:01 +02:00
Giovanni Mascellani
c052cd8998
vkd3d-shader/ir: Introduce a boilerplate to validate the generated IR.
...
For the moment the validator is trivial, it never fails. Checks will
be added incrementally.
2023-09-22 11:06:13 +02:00
Henri Verbeet
da89da2bf3
vkd3d-shader: Hide support for DXIL sources.
...
Unfortunately this is not sufficiently ready to release.
2023-09-18 21:04:19 +02:00
Conor McCarthy
bad4c74002
vkd3d-shader: Match only UAV descriptors in vkd3d_shader_scan_add_uav_flag().
...
Fixes compilation failures in Cyberpunk 2077 due to missing UAV counter
flag.
2023-09-04 20:25:31 +02:00
Conor McCarthy
bf49a1a95b
vkd3d-shader/dxil: Declare shader outputs.
2023-08-30 22:48:50 +02:00
Zebediah Figura
622311da8e
vkd3d-shader: Add a flag marking raw buffers to struct vkd3d_shader_descriptor_info.
2023-08-23 22:45:04 +02:00
Zebediah Figura
c1ebba9515
vkd3d-shader: Add structure stride to struct vkd3d_shader_descriptor_info1.
2023-08-23 22:45:04 +02:00
Zebediah Figura
88f85ffb50
vkd3d-shader: Add constant buffer size to struct vkd3d_shader_descriptor_info1.
2023-08-23 22:45:04 +02:00
Zebediah Figura
8c465c81cf
vkd3d-shader: Add sample count to struct vkd3d_shader_descriptor_info1.
2023-08-23 22:45:04 +02:00
Zebediah Figura
ccedb7f711
vkd3d-shader: Set descriptor flags in the caller to vkd3d_shader_scan_add_descriptor().
...
Return the vkd3d_shader_descriptor_info1 from that function.
2023-08-23 22:45:02 +02:00
Zebediah Figura
983d01df8c
vkd3d-shader: Get rid of the uav_ranges array.
...
This is now redundant; the register ID is encoded into the scan descriptors.
2023-08-14 18:38:11 +02:00
Zebediah Figura
7d02922541
vkd3d-shader: Add register ID to struct vkd3d_shader_descriptor_info1.
2023-08-14 18:38:11 +02:00
Zebediah Figura
4e9798f6f7
vkd3d-shader: Introduce struct vkd3d_shader_scan_descriptor_info1.
2023-08-14 18:38:11 +02:00
Zebediah Figura
fd4a820c4b
vkd3d-shader: Centralize cleanup on error in scan_with_parser().
2023-08-14 18:38:11 +02:00
Zebediah Figura
9c5cb2de18
vkd3d-shader: Factor more code into vkd3d_shader_scan_get_uav_descriptor_info().
2023-08-14 18:38:11 +02:00