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

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-05-16 12:47:53 -05:00 committed by Alexandre Julliard
parent 9f73897725
commit 0238f60d8b

View File

@ -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));