Commit Graph

190 Commits

Author SHA1 Message Date
Zebediah Figura
7b3c47ba2e vkd3d-shader/tpf: Write the field offset in bytes. 2024-05-06 22:12:48 +02:00
Zebediah Figura
2480eec98b vkd3d-shader/hlsl: Move the "base_type" member to the class-specific union. 2024-05-06 22:12:41 +02:00
Zebediah Figura
d9f7a88329 vkd3d-shader/hlsl: Make HLSL_TYPE_PIXELSHADER into a separate class. 2024-05-06 22:12:37 +02:00
Zebediah Figura
874937dab4 vkd3d-shader/hlsl: Make HLSL_TYPE_VERTEXSHADER into a separate class. 2024-05-06 22:12:34 +02:00
Zebediah Figura
d7da278693 vkd3d-shader/hlsl: Make HLSL_TYPE_RENDERTARGETVIEW into a separate class. 2024-04-23 22:37:09 +02:00
Zebediah Figura
ee2bde3aba vkd3d-shader/hlsl: Make HLSL_TYPE_DEPTHSTENCILVIEW into a separate class. 2024-04-23 22:37:06 +02:00
Zebediah Figura
76971d811e vkd3d-shader/hlsl: Make HLSL_TYPE_TECHNIQUE into a separate class. 2024-04-23 22:36:51 +02:00
Zebediah Figura
3c8c7426df vkd3d-shader/hlsl: Make HLSL_TYPE_PASS into a separate class. 2024-04-23 22:36:38 +02:00
Zebediah Figura
24d3a352a6 vkd3d-shader/hlsl: Make HLSL_TYPE_EFFECT_GROUP into a separate class. 2024-04-23 22:36:32 +02:00
Zebediah Figura
171e097268 vkd3d-shader/hlsl: Make HLSL_TYPE_UAV into a separate class. 2024-04-19 22:23:20 +02:00
Zebediah Figura
93d7cd1785 vkd3d-shader/hlsl: Make HLSL_TYPE_TEXTURE into a separate class. 2024-04-19 22:23:19 +02:00
Zebediah Figura
220362cbad vkd3d-shader/hlsl: Make HLSL_TYPE_SAMPLER into a separate class. 2024-04-19 22:23:18 +02:00
Zebediah Figura
f57db442b0 vkd3d-shader/hlsl: Make HLSL_TYPE_STRING into a separate class. 2024-04-19 22:23:16 +02:00
Zebediah Figura
cdcf2da2eb vkd3d-shader/hlsl: Make HLSL_TYPE_VOID into a separate class. 2024-04-19 22:23:14 +02:00
Zebediah Figura
0e3377a1be vkd3d-shader/hlsl: Avoid using HLSL_CLASS_OBJECT without checking the base type.
As the diffstat shows, HLSL_CLASS_OBJECT does not really have much in common.
Resource types (TEXTURE, SAMPLER, UAV) sometimes behave similarly to each other,
but do not generally behave similarly to effect-specific types (string, shader,
state, view). Most consumers of HLSL_CLASS_OBJECT subsequently check the base
type anyway.

Hence we want to replace HLSL_TYPE_* with individual classes for object types.
As a first step, change the last few places that only check HLSL_CLASS_OBJECT.
2024-04-09 12:27:55 -05:00
Zebediah Figura
c5f507ac38 vkd3d-shader/hlsl: Add SM5.1 shader target strings. 2024-04-09 12:27:47 -05:00
Francisco Casas
8fca801591 vkd3d-shader/tpf: Use the extra_bits field for _nz on discard. 2024-04-09 12:27:03 -05:00
Francisco Casas
3a0a4b625f vkd3d-shader/hlsl: Merge HLSL_OP3_MOVC into HLSL_OP3_TERNARY. 2024-04-09 12:27:02 -05:00
Zebediah Figura
2247288003 vkd3d-shader/tpf: Set the user-packed flag for sm5.0 resources as well. 2024-03-27 22:36:39 +01:00
Zebediah Figura
7b87895289 vkd3d-shader/tpf: Write the component count as the column count for structs. 2024-03-27 22:36:37 +01:00
Zebediah Figura
5bf23cb2f5 vkd3d-shader/tpf: Explicitly write the class and base type for non-numeric types.
Avoid relying on that information being stored in the hlsl_type.
2024-03-27 22:36:36 +01:00
Zebediah Figura
34e9c101e8 vkd3d-shader/tpf: Do not write structs with no numeric fields into the RDEF. 2024-03-27 22:36:35 +01:00
Zebediah Figura
622fcda9ee vkd3d-shader/tpf: Do not write non-numeric struct fields into the RDEF. 2024-03-27 22:36:33 +01:00
Henri Verbeet
abf76372e0 vkd3d-shader/ir: Pass a struct vsir_program to vsir_validate(). 2024-03-14 23:24:29 +01:00
Conor McCarthy
6dd54eeb09 vkd3d-shader/spirv: Support zero-initialisation for workgroup memory. 2024-03-14 22:48:41 +01:00
Giovanni Mascellani
1690b0b554 vkd3d-shader: Remove the bytecode fields from vkd3d_shader_desc. 2024-03-11 22:09:32 +01:00
Giovanni Mascellani
204c8afb9c vkd3d-shader/dxbc: Remove flag is_dxil.
The full shader profile is already available in vsir_program.
2024-03-11 22:09:31 +01:00
Giovanni Mascellani
470d83a9da vkd3d-shader: Move shader signatures to vsir_program. 2024-03-11 22:09:31 +01:00
Giovanni Mascellani
56dc0c9842 vkd3d-shader/dxbc: Decouple vkd3d_shader_desc from DXBC parsing. 2024-03-11 22:09:30 +01:00
Giovanni Mascellani
5204b92fa0 vkd3d-shader/tpf: Remove a useless parameter to shader_sm4_init(). 2024-03-11 22:09:28 +01:00
Zebediah Figura
9177df883e vkd3d-shader/hlsl: Write the SFI0 section and "REQUIRES_ROVS" flag when ROVs are used. 2024-03-04 22:34:46 +01:00
Henri Verbeet
7029d821be configure: Build with -Wtype-limits.
libs/vkd3d-shader/tpf.c: In function ‘write_sm4_unary_op_with_two_destinations’:
libs/vkd3d-shader/tpf.c:4489:24: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(1 - dst_idx >= 0);
                        ^~
libs/vkd3d-shader/tpf.c: In function ‘write_sm4_binary_op_with_two_destinations’:
libs/vkd3d-shader/tpf.c:4549:24: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(1 - dst_idx >= 0);
                        ^~
2024-02-22 22:46:22 +01:00
Henri Verbeet
d4223a03c8 vkd3d-shader/hlsl: Replace HLSL_MODIFIER_RASTERIZER_ORDERED with a hlsl_type.e.resource flag. 2024-02-21 23:23:08 +01:00
Henri Verbeet
49d14613a5 vkd3d-shader/hlsl: Introduce hlsl_type.e.resource. 2024-02-21 23:23:06 +01:00
Evan Tang
7b41abaa1b vkd3d-shader/hlsl: Support SV_PrimitiveID in pixel shaders. 2024-02-19 21:12:23 +01:00
Francisco Casas
c249461e97 vkd3d-shader/hlsl: Parse Buffer types. 2024-02-19 21:11:55 +01:00
Evan Tang
ee867bd470 vkd3d-shader/hlsl: Parse rasteriser-ordered view types. 2024-02-15 23:29:46 +01:00
Henri Verbeet
d38221bd68 vkd3d-shader/ir: Pass a struct vsir_program to shader_parser_get_src_params(). 2024-02-01 00:08:23 +01:00
Henri Verbeet
47ec24ebad vkd3d-shader/ir: Pass a struct vsir_program to shader_parser_get_dst_params(). 2024-02-01 00:08:22 +01:00
Giovanni Mascellani
1f536238a8 vkd3d-shader: Use 64 bit swizzles for 64 bit data types in VSIR.
The handling of write masks and swizzles for 64 bit data types is
currently irregular: write masks are always 64 bit, while swizzles
are usually 32 bit, except for SSA registers with are 64 bit.
With this change we always use 64 bit swizzles, in order to make
the situation less surprising and make it easier to convert
registers between SSA and TEMP.

64 bit swizzles are always required to have X in their last two
components.
2024-01-29 22:33:33 +01:00
Henri Verbeet
98c6e85b33 vkd3d-shader/ir: Store control point counts in struct vsir_program. 2024-01-23 20:27:32 +01:00
Giovanni Mascellani
dc56320b31 vkd3d-shader/tpf: Support SV_ViewportArrayIndex in pixel and vertex shaders. 2024-01-22 22:19:14 +01:00
Giovanni Mascellani
3a90f3e29d vkd3d-shader/tpf: Support SV_InstanceID in vertex shaders. 2024-01-22 22:19:13 +01:00
Giovanni Mascellani
b500381b5c vkd3d-shader/tpf: Support SV_RenderTargetArrayIndex in pixel and vertex shaders. 2024-01-22 22:19:12 +01:00
Henri Verbeet
adc02eada8 vkd3d-shader/ir: Store the temporary register count in struct vsir_program. 2024-01-22 22:18:53 +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
Conor McCarthy
c40093474e vkd3d-shader/tpf: Validate sysvals in index range declarations. 2024-01-17 22:29:01 +01:00
Conor McCarthy
418e8d8100 vkd3d-shader/ir: Expand index range write masks to cover all element masks.
For example, this occurred in a shader:

reg_idx write_mask
   0      xyz
   1      xyzw
   2      xyzw
   3      xyz

The dcl_indexrange instruction covered only xyz, so once merged, searching for
xyzw failed.

It is impossible to declare an input array where elements have different
component counts, but the optimiser can create this case. One way for
this to occur is to dynamically index input values via a local array
containing copies of the input values. The optimiser converts this to
dynamically indexed inputs.
2024-01-17 22:28:56 +01:00
Conor McCarthy
559d9d4ee0 vkd3d-shader/ir: Include an initial label instruction in the first control flow block. 2024-01-17 22:28:41 +01:00