Commit Graph

6533 Commits

Author SHA1 Message Date
Francisco Casas
cf7fade580 vkd3d-shader/hlsl: Store the thread group size in the vsir program. 2024-10-24 20:48:20 +02:00
Giovanni Mascellani
91701f8303 vkd3d-shader: Warn instead of erroring out when failing to dump a shader.
It's a debug operation and shouldn't be considered fatal, even
for development workflows.
2024-10-23 16:14:33 +02:00
Giovanni Mascellani
6a03369f84 vkd3d-shader: Do not dump the target shader if compilation failed.
Otherwise we'd use unitialized data.
2024-10-23 16:14:33 +02:00
Giovanni Mascellani
a1f712d100 vkd3d: Incorporate mutable descriptors in the push descriptor disabling logic.
The computation is also written in the code now instead of in
the comments.
2024-10-23 16:12:50 +02:00
Giovanni Mascellani
bc2b137df9 vkd3d: Only put the mutable descriptor set once in the pipeline layout.
Currently the mutable descriptor set is repeated many times in the
pipeline layout in order to cover the indices for all the
descriptor types that would be present if mutable descriptors were
not used. This is useless and wasteful, but was necessary before
the descriptor sets backing the SRV-UAV-CBV heap were moved at the
end of the allocation table because descriptor set indices are
currently a compile-time constant in many places.

Now this is not needed any more and we can just avoid putting
many copies of the mutable descriptor set in the pipeline layout,
making it easier to meet Vulkan implementation limits.
2024-10-23 16:12:06 +02:00
Giovanni Mascellani
96b324c156 vkd3d: Move descriptor sets backing the SRV-UAV-CBV heap at the end.
So that when mutable descriptors are in use we can avoid putting
the other descriptor sets backing the SRV-UAV-CBV descriptor heap
in the pipeline layout altogether.
2024-10-23 16:07:54 +02:00
Giovanni Mascellani
8d030718ae vkd3d: Introduce an enumerant for the mutable descriptor set.
So we avoid hardcoding that it is number zero. There are two
goals here: first making the code easier to understand and
second allow reshuffling the descriptor set allocation in a
later commit.
2024-10-23 16:07:36 +02:00
Elizabeth Figura
32e6a1bb4d vkd3d-shader: Validate the parsed shader in vsir_parse(). 2024-10-23 16:02:09 +02:00
Elizabeth Figura
3a3f95e1e7 vkd3d-shader: Factor out a vsir_parse() helper. 2024-10-23 16:02:09 +02:00
Conor McCarthy
4889c71857 vkd3d: Zero the pipeline state UAV counter view array when the state is invalidated. (Valgrind)
Otherwise a comparison with uninitialised data occurs in
d3d12_command_list_update_descriptor_table() if virtual heaps are used.
2024-10-22 20:42:06 +02:00
Henri Verbeet
1113d24a70 vkd3d-shader/ir: Store the global flags in struct vsir_program. 2024-10-22 20:40:31 +02:00
Henri Verbeet
21e9029177 vkd3d-shader/glsl: Implement VKD3DSIH_SAMPLE_C_LZ. 2024-10-22 20:39:31 +02:00
Henri Verbeet
5958e527e5 vkd3d-shader/glsl: Implement VKD3DSIH_SAMPLE_C. 2024-10-22 20:39:31 +02:00
Henri Verbeet
19c493722e vkd3d-shader/glsl: Implement VKD3DSIH_SAMPLE_B. 2024-10-22 20:39:31 +02:00
Henri Verbeet
e408f1d984 vkd3d-shader/glsl: Implement support for the VKD3DSPR_THREADID register. 2024-10-22 20:39:31 +02:00
Henri Verbeet
f76dd80cba vkd3d-shader/glsl: Implement VKD3DSIH_LD_UAV_TYPED. 2024-10-22 20:39:31 +02:00
Giovanni Mascellani
8d8e0fd55a tests: Test mismatching RTV and pixel shader output types. 2024-10-22 20:38:18 +02:00
Giovanni Mascellani
7fbed358c9 ci: Build DXC for release.
Otherwise a lot of assertions trigger, even for legitimate uses.
2024-10-22 20:32:51 +02:00
Giovanni Mascellani
dff7c0e7b8 tests: Mark interface packing pipeline creation as todo on MoltenVK.
Most Vulkan drivers are happy to compile a pipeline with interstage
interface mismatches, even if the pipeline will be broken. Metal,
and therefore MoltenVK, instead doesn't and errors out immediately.
2024-10-22 20:32:51 +02:00
Giovanni Mascellani
b411086398 tests: Use the appropriate RTV format in minimum-precision.shader_test. 2024-10-22 20:29:25 +02:00
Giovanni Mascellani
987dbe31e3 tests: Use appropriate RTV formats in max-min.shader_test. 2024-10-22 20:29:25 +02:00
Giovanni Mascellani
bc830fa06b tests: Compute the correct value for condition conjunctions.
Currently the value of the last conjunct is returned.
2024-10-22 20:29:25 +02:00
Nikolay Sivov
cf3e251a9f vkd3d-shader/hlsl: Implement the f32tof16() intrinsic.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-22 20:28:33 +02:00
Shaun Ren
f54797bae5 vkd3d-shader/hlsl: Support discard for SM1. 2024-10-22 20:27:34 +02:00
Francisco Casas
2a8c1b2823 vkd3d-shader/hlsl: Sort signature elements by register id. 2024-10-22 20:25:40 +02:00
Francisco Casas
51d05c1844 vkd3d-shader/hlsl: Optimize interstage signatures. 2024-10-22 20:15:15 +02:00
Francisco Casas
88dd082160 vkd3d-shader/hlsl: Allow prioritizing smaller writemasks when allocating signature elements.
For now this doesn't have effect yet, until semantic allocation is
optimized.
2024-10-22 20:06:15 +02:00
Francisco Casas
d562b03c43 vkd3d-shader/hlsl: Allow to force alignment on some semantic vars.
This is required to properly optimize signatures, because these
semantics must be alligned while being packed:
- Array elements.
- The first fields of structs.
- Major vectors of a matrix.

For now this has no effect since semantics are allocated with reg_size
4, but will have effect when optimizing interstage signatures.
2024-10-22 20:04:41 +02:00
Francisco Casas
7fd6c29ee8 vkd3d-shader/hlsl: Allow accounting for interpolation mode when allocating semantics.
For now this has no effect since semantics are allocated with reg_size
4, but will have effect when optimizing interstage signatures.
2024-10-22 20:03:39 +02:00
Francisco Casas
b65f5fb069 vkd3d-shader/hlsl: Also pass field storage modifiers to output signature elements.
The generated pixel shader input signature must be consistent with the
generated vertex shader output signature for the same data type.

Since the interpolation mode affects allocation order, the allocator
needs to know the modifiers for both input and output signature elements.
2024-10-22 19:29:11 +02:00
Francisco Casas
7180a96741 vkd3d-shader/hlsl: Use a register_allocator to allocate semantic registers. 2024-10-22 19:23:33 +02:00
Francisco Casas
9ce7b7806f vkd3d-shader/hlsl: Add mode field to register_allocator allocations. 2024-10-22 19:23:22 +02:00
Francisco Casas
d9b631182e tests: Add signature reflection test with structs. 2024-10-22 19:15:42 +02:00
Nikolay Sivov
fb2b974466 vkd3d-shader/hlsl: Handle snorm/unorm types as resource formats.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-22 19:14:51 +02:00
Elizabeth Figura
6fd1a1ce7e tests: Test point sprite. 2024-10-22 19:14:05 +02:00
Elizabeth Figura
a492d64fef vkd3d-shader/ir: Allow controlling point sprite through a parameter. 2024-10-22 19:14:02 +02:00
Nikolay Sivov
8a3fe9cd1e vkd3d-shader/fx: Implement parsing groups and techniques.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-21 18:23:33 +02:00
Giovanni Mascellani
ae772d40cf vkd3d: Disable push descriptors when that's helpful to stay within 8 descriptor sets. 2024-10-21 18:22:15 +02:00
Giovanni Mascellani
3bf114f3c3 vkd3d/device: Trace which descriptor heap implementation is being used.
The descriptor heap implementation is a rather central behavior element
in vkd3d, so it's useful to have all the relevant information logged
in a single place.
2024-10-21 18:22:15 +02:00
Giovanni Mascellani
ed4d45355a vkd3d-shader/ir: Represent the normalisation level with an enumeration. 2024-10-21 18:21:39 +02:00
Giovanni Mascellani
9f3b21cc78 tests: Mark latching the predicated value as todo on llvmpipe.
Vulkan doesn't mandate whether the predicated value should be latched
when beginning the predicated section or re-read at each operation.
2024-10-21 18:20:38 +02:00
Giovanni Mascellani
1301014b28 tests: Mark creating an 8x MSAA render target as buggy on llvmpipe. 2024-10-21 18:20:38 +02:00
Giovanni Mascellani
3c86094371 tests: Mark a sampling test as buggy on llvmpipe.
Vulkan doesn't mandate whether sampling exactly in the middle between
two levels should resolve to one or the other, while D3D specifies
that it should result into sampling the higher level. llvmpipe
happens to choose the lower one instead, at least in some cases.
2024-10-21 18:20:38 +02:00
Shaun Ren
773e1bbeae tests: Test signature reflection for domain shaders. 2024-10-21 18:19:33 +02:00
Shaun Ren
abed6d9cb7 vkd3d-shader/tpf: Implement semantics for domain shaders. 2024-10-21 18:18:25 +02:00
Shaun Ren
0273ff007b vkd3d-shader/tpf: Write domain shader declarations. 2024-10-21 18:18:00 +02:00
Shaun Ren
26efba30b4 vkd3d-shader/tpf: Use vpc input registers for domain shaders. 2024-10-21 18:17:06 +02:00
Shaun Ren
2b897296a1 vkd3d-shader/tpf: Write the input signature of domain shaders as PCSG. 2024-10-21 18:16:50 +02:00
Shaun Ren
768b19d410 vkd3d-shader/ir: Validate control point counts correctly.
Allow zero input control points for domain shaders, and zero output
control points for hull shaders.
2024-10-21 18:10:13 +02:00
Shaun Ren
976fe27836 vkd3d-utils: Return correct use masks during reflection. 2024-10-21 18:09:39 +02:00