Commit eef3e3da authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3dcompiler: Pass a struct source_location to hlsl_report_message().

parent 77fe277a
...@@ -1061,8 +1061,8 @@ enum hlsl_error_level ...@@ -1061,8 +1061,8 @@ enum hlsl_error_level
}; };
void WINAPIV hlsl_message(const char *fmt, ...) PRINTF_ATTR(1,2) DECLSPEC_HIDDEN; void WINAPIV hlsl_message(const char *fmt, ...) PRINTF_ATTR(1,2) DECLSPEC_HIDDEN;
void WINAPIV hlsl_report_message(const char *filename, DWORD line, DWORD column, void WINAPIV hlsl_report_message(const struct source_location loc,
enum hlsl_error_level level, const char *fmt, ...) PRINTF_ATTR(5,6) DECLSPEC_HIDDEN; enum hlsl_error_level level, const char *fmt, ...) PRINTF_ATTR(3,4) DECLSPEC_HIDDEN;
static inline struct hlsl_ir_expr *expr_from_node(const struct hlsl_ir_node *node) static inline struct hlsl_ir_expr *expr_from_node(const struct hlsl_ir_node *node)
{ {
......
...@@ -1191,8 +1191,7 @@ static struct hlsl_type *expr_common_type(struct hlsl_type *t1, struct hlsl_type ...@@ -1191,8 +1191,7 @@ static struct hlsl_type *expr_common_type(struct hlsl_type *t1, struct hlsl_type
if (t1->type > HLSL_CLASS_LAST_NUMERIC || t2->type > HLSL_CLASS_LAST_NUMERIC) if (t1->type > HLSL_CLASS_LAST_NUMERIC || t2->type > HLSL_CLASS_LAST_NUMERIC)
{ {
hlsl_report_message(loc->file, loc->line, loc->col, HLSL_LEVEL_ERROR, hlsl_report_message(*loc, HLSL_LEVEL_ERROR, "non scalar/vector/matrix data type in expression");
"non scalar/vector/matrix data type in expression");
return NULL; return NULL;
} }
...@@ -1201,8 +1200,7 @@ static struct hlsl_type *expr_common_type(struct hlsl_type *t1, struct hlsl_type ...@@ -1201,8 +1200,7 @@ static struct hlsl_type *expr_common_type(struct hlsl_type *t1, struct hlsl_type
if (!expr_compatible_data_types(t1, t2)) if (!expr_compatible_data_types(t1, t2))
{ {
hlsl_report_message(loc->file, loc->line, loc->col, HLSL_LEVEL_ERROR, hlsl_report_message(*loc, HLSL_LEVEL_ERROR, "expression data types are incompatible");
"expression data types are incompatible");
return NULL; return NULL;
} }
...@@ -1286,14 +1284,13 @@ struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_ ...@@ -1286,14 +1284,13 @@ struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_
if (!implicit_compatible_data_types(src_type, dst_type)) if (!implicit_compatible_data_types(src_type, dst_type))
{ {
hlsl_report_message(loc->file, loc->line, loc->col, HLSL_LEVEL_ERROR, hlsl_report_message(*loc, HLSL_LEVEL_ERROR, "can't implicitly convert %s to %s",
"can't implicitly convert %s to %s", debug_hlsl_type(src_type), debug_hlsl_type(dst_type)); debug_hlsl_type(src_type), debug_hlsl_type(dst_type));
return NULL; return NULL;
} }
if (dst_type->dimx * dst_type->dimy < src_type->dimx * src_type->dimy) if (dst_type->dimx * dst_type->dimy < src_type->dimx * src_type->dimy)
hlsl_report_message(loc->file, loc->line, loc->col, HLSL_LEVEL_WARNING, hlsl_report_message(*loc, HLSL_LEVEL_WARNING, "implicit truncation of vector type");
"implicit truncation of vector type");
TRACE("Implicit conversion from %s to %s.\n", debug_hlsl_type(src_type), debug_hlsl_type(dst_type)); TRACE("Implicit conversion from %s to %s.\n", debug_hlsl_type(src_type), debug_hlsl_type(dst_type));
...@@ -1341,9 +1338,7 @@ struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **ope ...@@ -1341,9 +1338,7 @@ struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **ope
if (operands[i]->data_type->dimx * operands[i]->data_type->dimy != 1 if (operands[i]->data_type->dimx * operands[i]->data_type->dimy != 1
&& operands[i]->data_type->dimx * operands[i]->data_type->dimy != type->dimx * type->dimy) && operands[i]->data_type->dimx * operands[i]->data_type->dimy != type->dimx * type->dimy)
{ {
hlsl_report_message(operands[i]->loc.file, hlsl_report_message(operands[i]->loc, HLSL_LEVEL_WARNING, "implicit truncation of vector/matrix type");
operands[i]->loc.line, operands[i]->loc.col, HLSL_LEVEL_WARNING,
"implicit truncation of vector/matrix type");
} }
if (!(cast = new_cast(operands[i], type, &operands[i]->loc))) if (!(cast = new_cast(operands[i], type, &operands[i]->loc)))
...@@ -1452,7 +1447,7 @@ struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *left, enum parse_assig ...@@ -1452,7 +1447,7 @@ struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *left, enum parse_assig
if (left->data_type->type > HLSL_CLASS_LAST_NUMERIC) if (left->data_type->type > HLSL_CLASS_LAST_NUMERIC)
{ {
hlsl_report_message(left->loc.file, left->loc.line, left->loc.col, HLSL_LEVEL_ERROR, hlsl_report_message(left->loc, HLSL_LEVEL_ERROR,
"writemask on a non scalar/vector/matrix type"); "writemask on a non scalar/vector/matrix type");
d3dcompiler_free(assign); d3dcompiler_free(assign);
return NULL; return NULL;
......
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