Commit Graph

4836 Commits

Author SHA1 Message Date
Elizabeth Figura
e781abc3fb vkd3d-shader: Write uninitialized components of COLOR0 as 1. 2024-11-04 15:21:09 +01:00
Elizabeth Figura
cc9fcee676 vkd3d-shader: Reduce masks to only read components in vsir_program_remap_output_signature(). 2024-11-04 15:11:54 +01:00
Elizabeth Figura
61bda1c054 vkd3d-shader: Always ensure a RET at the end of a program. 2024-11-04 15:06:02 +01:00
Nikolay Sivov
ad2208b726 vkd3d-shader/fx: Implement parsing shader resources types.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-29 14:52:39 +01:00
Nikolay Sivov
1a8e9ff94e vkd3d-shader/fx: Implement parsing shader objects.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-29 14:41:55 +01:00
Elizabeth Figura
3511b54040 vkd3d-shader/hlsl: Use early return in allocate_register().
Partly to avoid a spurious maybe-uninitialized warning, and partly because it's a more idiomatic structure.
2024-10-28 18:01:06 +01:00
Elizabeth Figura
08253504dc vkd3d-shader: Make an assert into an explicit check.
For some reason gcc without LTO thinks that component_count can overflow the
array here.
2024-10-28 18:01:06 +01:00
Elizabeth Figura
5883e01032 vkd3d-shader/fx: Remove an unnecessary hlsl_is_numeric_type().
Constants can only be numeric.
2024-10-28 18:01:06 +01:00
Elizabeth Figura
a595b96f62 vkd3d: Initialize vk_extensions in vk_init_device_caps().
Without LTO, gcc doesn't know that hresult_from_vk_result() will always return a
failure HRESULT for a failure VkResult, and so thinks that we might exit from
vkd3d_check_device_extensions() with a success HRESULT but without initializing
vk_extensions.
2024-10-28 18:01:06 +01:00
Henri Verbeet
9690ffff61 vkd3d-shader/spirv: Handle oPts in spirv_compiler_get_register_name(). 2024-10-28 17:54:43 +01:00
Henri Verbeet
fa6d03a4cb vkd3d-shader/d3d-asm: Implement support for VKD3DSPR_PARAMETER registers. 2024-10-28 17:54:20 +01:00
Nikolay Sivov
89e5912fd2 vkd3d-shader/hlsl: Implement RWByteAddressBuffer.Store*() methods.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-28 17:51:04 +01:00
Nikolay Sivov
cf27065b7d vkd3d-shader/hlsl: Add parser support for the RWByteAddressBuffer type.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-28 17:44:28 +01:00
Nikolay Sivov
4195a2f18a vkd3d-shader/hlsl: Use a more compact way to store object method configurations.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-28 17:41:46 +01:00
Elizabeth Figura
390a330b8e vkd3d-shader/hlsl: Avoid leaking the block in the subscript rule. 2024-10-28 15:40:41 +01:00
Elizabeth Figura
bb74180659 vkd3d-shader/hlsl: Return an error expression when an invalid subscript is used. 2024-10-28 15:40:41 +01:00
Elizabeth Figura
7905c47765 vkd3d-shader/hlsl: Handle error expressions in array sizes. 2024-10-28 15:40:41 +01:00
Elizabeth Figura
8b98e483ac vkd3d-shader/hlsl: Handle error expressions in return statements. 2024-10-28 15:40:41 +01:00
Elizabeth Figura
94cf432035 vkd3d-shader/hlsl: Handle error expressions in conditions. 2024-10-28 15:40:41 +01:00
Nikolay Sivov
5eff8bf918 vkd3d-shader/hlsl: Handle SV_GroupIndex.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-10-24 20:54:04 +02:00
Henri Verbeet
5e9edf25d0 vkd3d-shader/glsl: Implement VKD3DSIH_GATHER4. 2024-10-24 20:52:37 +02:00
Henri Verbeet
d477a00734 vkd3d-shader/glsl: Implement VKD3DSIH_SAMPLE_GRAD. 2024-10-24 20:52:37 +02:00
Henri Verbeet
d58282c6d1 vkd3d-shader/glsl: Implement VKD3DSIH_SAMPLE_LOD. 2024-10-24 20:52:37 +02:00
Henri Verbeet
85697d76be vkd3d-shader/glsl: Implement VKD3DSIH_UMAX and VKD3DSIH_UMIN. 2024-10-24 20:52:37 +02:00
Henri Verbeet
6a119b6946 vkd3d-shader/glsl: Implement VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL. 2024-10-24 20:52:37 +02:00
Francisco Casas
9d82915629 vkd3d-shader/hlsl: Make allocation functions static again. 2024-10-24 20:50:59 +02:00
Francisco Casas
23be6ed0dd vkd3d-shader/hlsl: Store temp declarations in the vsir program.
Move the temp allocation back to hlsl_codegen.c.

Note that the DCL_TEMPS instructions wouldn't be necessary if we had the
capacity to store the temp_count for both the main program and the patch
constant program (or more generally speaking, a temp_count for all
phases).

The plan is to eventually also move the HS_CONTROL_POINT and
HS_FORK_PHASE markers to the vsir_program, making it able to contain
both functions.
2024-10-24 20:50:59 +02:00
Francisco Casas
158bf794e6 vkd3d-shader/hlsl: Introduce hlsl_ir_vsir_instruction_ref, again.
This node type will be deleted (again) once the hlsl->vsir->tpf
translation is complete. It serves the purpose of allowing to keep
both real hlsl_ir_nodes and vsir_instructions in the hlsl_block,
until all the former can be translated into the latter.
2024-10-24 20:50:59 +02:00
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
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