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

@@ -135,9 +135,7 @@ static bool replace_deref_path_with_offset(struct hlsl_ctx *ctx, struct hlsl_der
struct hlsl_block block;
assert(deref->var);
/* register offsets shouldn't be used before this point is reached. */
assert(!deref->offset.node);
assert(!hlsl_deref_is_lowered(deref));
type = hlsl_deref_get_type(ctx, deref);