mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
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:
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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user