Commit Graph

289 Commits

Author SHA1 Message Date
733141720a vkd3d-shader/hlsl: Introduce a hlsl_block_cleanup() helper. 2023-04-18 21:59:42 +02:00
dc7514afc9 vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_float_constant(). 2023-04-18 21:59:39 +02:00
b23ef3ca3b vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_cast() and hlsl_new_copy(). 2023-04-18 21:59:37 +02:00
1bf3aa9275 vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_bool_constant(). 2023-04-18 21:59:34 +02:00
5c285adc6b vkd3d-shader/hlsl: Use hlsl_ir_index for array and record access.
From this point on, it is no longer true that only hlsl_ir_loads can
return objects, because an object can also come from chain of
hlsl_ir_indexes that ends in an hlsl_ir_load.

The lower_index_loads pass takes care of lowering all hlsl_ir_indexes
into hlsl_ir_loads.

For this reason, hlsl_resource_load_params now expects both the resource
as the sampler to be just an hlsl_ir_node pointer instead of a pointer
to a more specific hlsl_ir_load.
2023-04-13 23:05:32 +02:00
741c9e5893 vkd3d-shader/hlsl: Introduce hlsl_ir_index.
This node type is intended for use during parse-time.

While we parse an indexing expression such as "a[3]", we don't know if
it will end up as part of an expression (in which case it must be folded
into a load) or it is for the lhs of a store (in which case it must be
folded into the store's deref).
2023-04-13 23:05:25 +02:00
725d408974 vkd3d-shader/hlsl: Introduce an hlsl_block_init() helper. 2023-04-06 17:51:40 +02:00
1da5a9a490 vkd3d-shader/hlsl: Introduce an hlsl_block_add_block() helper. 2023-04-06 17:51:38 +02:00
ceac81b816 vkd3d-shader/hlsl: Introduce an hlsl_block_add_instr() helper. 2023-04-06 17:51:36 +02:00
60237cb773 vkd3d-shader/hlsl: Don't allow manual and automatic cbuffer offset packing. 2023-04-04 21:59:45 +02:00
4aca335f42 vkd3d-shader/hlsl: Parse packoffset(). 2023-04-04 21:59:40 +02:00
9b70971696 vkd3d-shader/hlsl: Rename struct hlsl_reg_reservation fields. 2023-04-04 21:59:39 +02:00
7a9e393ea0 vkd3d-shader/hlsl: Rename the "type" field of struct hlsl_type to "class".
To be consistent with enum hlsl_type_class and HLSL_CLASS_*.
2023-04-03 17:59:24 +02:00
4110f1e547 vkd3d-shader: Fix a few typos in the comments. 2023-03-15 20:13:27 +01:00
ae2f777a4d vkd3d-shader/hlsl: Parse multisample texture type names. 2023-03-08 20:15:09 +01:00
75ab9d31ef vkd3d-shader/hlsl: Store the matrix majority as a type modifiers bitmask. 2023-02-28 22:06:58 +01:00
891217664a vkd3d-shader/hlsl: Support case-insensitive lookup for builtin 'dword' type. 2023-02-23 21:46:38 +01:00
e0031d2a1f vkd3d-shader/hlsl: Keep an hlsl_reg for each register set in hlsl_ir_var. 2023-02-22 18:28:19 +01:00
d07247249a vkd3d-shader/hlsl: Store the type's register size for each register set. 2023-02-22 18:28:19 +01:00
d86db8bcbe vkd3d-shader/hlsl: Support lit() intrinsic. 2023-02-21 21:09:52 +01:00
7c3dadce6b vkd3d-shader/hlsl: Write SM4 break instructions. 2023-02-15 21:53:21 +01:00
4b944517b7 vkd3d-shader/hlsl: Inline function calls. 2023-02-13 22:16:53 +01:00
8bdee6681b vkd3d-shader/hlsl: Lower return statements. 2023-02-13 22:16:51 +01:00
bb41c3b5fe vkd3d-shader/hlsl: Skip functions that don't have a body when looking for the entry point. 2023-02-13 22:16:48 +01:00
25d49b518d vkd3d-shader/hlsl: Put synthetic variables into a dummy scope.
Prevent them from being ever looked up.

Our naming scheme for synthetic variables already effectively prevents this, but
this is better for clarity. We also will need to be able to move some named
variables into a dummy scope to account for complexities around function
definition and declarations.
2023-02-07 22:15:06 +01:00