Commit 76525af7 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3dcompiler: Allow casts to arrays.

parent 1acf5a04
......@@ -1488,7 +1488,10 @@ unary_expr: postfix_expr
return 1;
}
dst_type = $3;
if ($4)
dst_type = new_array_type($3, $4);
else
dst_type = $3;
if (!compatible_data_types(src_type, dst_type))
{
......
......@@ -854,8 +854,15 @@ struct hlsl_type *new_hlsl_type(const char *name, enum hlsl_type_class type_clas
struct hlsl_type *new_array_type(struct hlsl_type *basic_type, unsigned int array_size)
{
FIXME("stub.\n");
return NULL;
struct hlsl_type *type = new_hlsl_type(NULL, HLSL_CLASS_ARRAY, HLSL_TYPE_FLOAT, 1, 1);
if (!type)
return NULL;
type->modifiers = basic_type->modifiers;
type->e.array.elements_count = array_size;
type->e.array.type = basic_type;
return type;
}
struct hlsl_type *get_type(struct hlsl_scope *scope, const char *name, BOOL recursive)
......@@ -1791,6 +1798,12 @@ const char *debug_hlsl_type(const struct hlsl_type *type)
if (type->type == HLSL_CLASS_STRUCT)
return "<anonymous struct>";
if (type->type == HLSL_CLASS_ARRAY)
{
name = debug_base_type(type->e.array.type);
return wine_dbg_sprintf("%s[%u]", name, type->e.array.elements_count);
}
name = debug_base_type(type);
if (type->type == HLSL_CLASS_SCALAR)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment