Zebediah Figura : vkd3d-shader: Sanity-check the offset data type in hlsl_reg_from_deref().

Alexandre Julliard julliard at winehq.org
Tue May 18 15:41:58 CDT 2021


Module: vkd3d
Branch: master
Commit: 0238f60d8b53e78cb30e1ab9f6ee9255c4905528
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=0238f60d8b53e78cb30e1ab9f6ee9255c4905528

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Sun May 16 12:47:53 2021 -0500

vkd3d-shader: Sanity-check the offset data type in hlsl_reg_from_deref().

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d-shader/hlsl_codegen.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c
index 7dd919b..10bf80b 100644
--- a/libs/vkd3d-shader/hlsl_codegen.c
+++ b/libs/vkd3d-shader/hlsl_codegen.c
@@ -1171,6 +1171,11 @@ static struct hlsl_reg hlsl_reg_from_deref(const struct hlsl_deref *deref, const
     struct hlsl_reg ret = {0};
     unsigned int offset = 0;
 
+    /* We should always have generated a cast to UINT. */
+    if (offset_node)
+        assert(offset_node->data_type->type == HLSL_CLASS_SCALAR
+                && offset_node->data_type->base_type == HLSL_TYPE_UINT);
+
     if (offset_node && offset_node->type != HLSL_IR_CONSTANT)
     {
         FIXME("Dereference with non-constant offset of type %s.\n", hlsl_node_type_to_string(offset_node->type));




More information about the wine-cvs mailing list