Commit Graph

7024 Commits

Author SHA1 Message Date
Elizabeth Figura
d7cd33fd88 vkd3d-shader/hlsl: Use a block in prepend_input_var_copy(). 2025-02-05 13:53:53 +01:00
Elizabeth Figura
b7d7deb983 vkd3d-shader/hlsl: Pass the block to add_zero_mipmap_level(). 2025-02-05 13:18:42 +01:00
Elizabeth Figura
602103dcf0 vkd3d-shader/hlsl: Handle error instructions in add_switch(). 2025-02-05 13:18:42 +01:00
Elizabeth Figura
fb290f3847 vkd3d-shader/hlsl: Add an add_switch() helper. 2025-02-05 13:18:42 +01:00
Shaun Ren
2f77d56b77 tests: Test signature reflection for patch inputs in hull/domain shaders. 2025-02-03 16:36:21 +01:00
Shaun Ren
ec6b4ed4ff vkd3d-shader/hlsl: Generate vsir registers from patch variable derefs. 2025-02-03 16:36:16 +01:00
Shaun Ren
3fb241d4d6 tests/shader_runner: Support the negation of tag matches. 2025-02-03 16:15:11 +01:00
Shaun Ren
2a1e3b100b vkd3d-shader/hlsl: Allocate semantic registers for patch variables. 2025-02-03 16:15:11 +01:00
Shaun Ren
2ddbc69f1a vkd3d-shader/hlsl: Declare semantics for patch variables in vsir. 2025-02-03 16:15:03 +01:00
Shaun Ren
f127f0849e vkd3d-shader/hlsl: Generate vsir signature entries for patch variables. 2025-02-03 16:04:21 +01:00
Shaun Ren
aa29d0a2e5 vkd3d-shader/tpf: Improve readability of compat mapping in sm4_sysval_semantic_from_semantic_name(). 2025-02-03 16:04:21 +01:00
Shaun Ren
29abe73918 vkd3d-shader/hlsl: Implement input semantic variable copies for patch variables.
The semantic variables from a patch parameter are split as usual, with
the difference being that the semantic variable being added is a patch
variable itself, with the type being the split variable type, and its
number of control points being equal to the original patch variable's
number of control points. It is then stored in the original patch
variable as follows:

  for (i = 0; i < n; ++i)
      patch[i][f] := <inputpatch-sem-var>[i]

where n is the number of control points of "patch", and f is the field
index in patch corresponding to "<inputpatch-sem-var>".

We use special prefixes, "inputpatch-" or "outputpatch-", when adding
the semantic patch variables, in order to distinguish them from
non-patch semantic variables of the same name.
2025-02-03 16:04:11 +01:00
Shaun Ren
f5d216835a vkd3d-shader/hlsl: Add an "is_patch_constant_func" field to struct hlsl_ctx.
In anticipation of the need for is_patch_constant_func in
sm4_generate_vsir_reg_from_deref(), in order to generate vsir
registers from InputPatch/OutputPatch dereferences.
2025-02-03 16:00:38 +01:00
Shaun Ren
0c8414c13f tests/hlsl: Test OutputPatch usage in patch constant functions. 2025-02-03 15:59:07 +01:00
Francisco Casas
0f7bb922ba tests/shader_runner: Pass the correct buffer size to swprintf() in dxc_compiler_compile_shader().
swprintf() expects the length of the buffer in WCHARs instead of bytes,
so ARRAY_SIZE() is used instead of sizeof().

This caused almost all tests to terminate abruptly with the following
message, in my machine:

*** buffer overflow detected ***: terminated
2025-02-03 15:58:19 +01:00
Elizabeth Figura
f1412e422c vkd3d-shader/hlsl: Handle error instructions in add_shader_compilation(). 2025-01-29 17:58:00 +01:00
Elizabeth Figura
fbd17266cf vkd3d-shader/hlsl: Do not abort on variable redefinition.
There is no harm in defining two variables with the same name.
2025-01-29 17:58:00 +01:00
Elizabeth Figura
e40d4a0e12 vkd3d-shader/hlsl: Factor out the error message into hlsl_add_var(). 2025-01-29 17:58:00 +01:00
Elizabeth Figura
2863d86bcc vkd3d-shader/hlsl: Do not define a separate scope for function parameters.
Remove the no longer needed code to detect redefinition in this case.
2025-01-29 17:58:00 +01:00
Elizabeth Figura
75ef230fbe tests: Add some stress tests for scope and variable definition. 2025-01-29 17:58:00 +01:00
Shaun Ren
7d1e4a40b1 tests/hlsl: Test hull shader control point function output parameters. 2025-01-29 17:53:26 +01:00
Shaun Ren
73183d33c5 tests/hlsl: Test passthrough hull shader control point function. 2025-01-29 17:52:49 +01:00
Shaun Ren
8a5559ab17 tests/hlsl: Test the syntax of InputPatch/OutputPatch variables. 2025-01-29 17:51:18 +01:00
Shaun Ren
f064a4022a vkd3d-shader/hlsl: Validate and record InputPatch/OutputPatch types. 2025-01-29 17:45:46 +01:00
Shaun Ren
f4d5e05d96 vkd3d-shader/hlsl: Parse InputPatch and OutputPatch objects. 2025-01-29 17:41:51 +01:00