vkd3d-shader/hlsl: Introduce hlsl_deref_is_lowered() helper.

Some functions work with dereferences and need to know if they are
lowered yet.

This can be known checking if deref->offset.node is NULL or
deref->data_type is NULL. I am using the latter since it keeps working
even after the following patches that split deref->offset into
constant and variable parts.
This commit is contained in:
Francisco Casas
2023-10-04 15:31:46 -03:00
committed by Alexandre Julliard
parent e93568f290
commit 81be47c00b
Notes: Alexandre Julliard 2023-10-31 22:38:12 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/396
3 changed files with 15 additions and 17 deletions

View File

@@ -644,11 +644,17 @@ struct hlsl_deref
* The path is lowered to this single offset -- whose value may vary between SM1 and SM4 --
* before writing the bytecode.
* Since the type information cannot longer be retrieved from the offset alone, the type is
* stored in the data_type field. */
* stored in the data_type field, which remains NULL if the deref hasn't been lowered yet. */
struct hlsl_src offset;
struct hlsl_type *data_type;
};
/* Whether the path has been lowered to an offset or not. */
static inline bool hlsl_deref_is_lowered(const struct hlsl_deref *deref)
{
return !!deref->data_type;
}
struct hlsl_ir_load
{
struct hlsl_ir_node node;