winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2020
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
996 discussions
Start a n
N
ew thread
Zebediah Figura : d3dcompiler: Don't set the node type for return instructions.
by Alexandre Julliard
03 Mar '20
03 Mar '20
Module: wine Branch: master Commit: 1947f7fb808726d7c97c211180a6d03bff58b15b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1947f7fb808726d7c97c2111…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 1 22:55:27 2020 -0600 d3dcompiler: Don't set the node type for return instructions. Essentially just because it doesn't make sense to do so; a return instruction is not an expression usable as a source to other instructions. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/hlsl.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 34adab2855..3d04677f2e 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -483,6 +483,7 @@ static struct hlsl_ir_swizzle *get_swizzle(struct hlsl_ir_node *value, const cha static struct hlsl_ir_jump *new_return(struct hlsl_ir_node *value, struct source_location loc) { + struct hlsl_type *return_type = hlsl_ctx.cur_function->return_type; struct hlsl_ir_jump *jump = d3dcompiler_alloc(sizeof(*jump)); if (!jump) { @@ -492,16 +493,15 @@ static struct hlsl_ir_jump *new_return(struct hlsl_ir_node *value, struct source jump->node.type = HLSL_IR_JUMP; jump->node.loc = loc; jump->type = HLSL_IR_JUMP_RETURN; - jump->node.data_type = hlsl_ctx.cur_function->return_type; if (value) { - if (!(jump->return_value = implicit_conversion(value, jump->node.data_type, &loc))) + if (!(jump->return_value = implicit_conversion(value, return_type, &loc))) { d3dcompiler_free(jump); return NULL; } } - else if (jump->node.data_type->base_type != HLSL_TYPE_VOID) + else if (return_type->base_type != HLSL_TYPE_VOID) { hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, "non-void function must return a value");
1
0
0
0
Zebediah Figura : d3dcompiler: Verify a returned value against the function's type and cast it if necessary.
by Alexandre Julliard
03 Mar '20
03 Mar '20
Module: wine Branch: master Commit: 09b2e42e92a1dfe55ecdbb19b27922f39dd8c6c1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=09b2e42e92a1dfe55ecdbb19…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 1 22:55:26 2020 -0600 d3dcompiler: Verify a returned value against the function's type and cast it if necessary. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/d3dcompiler_private.h | 3 +++ dlls/d3dcompiler_43/hlsl.y | 24 +++++++++++++++++------- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 2 +- dlls/d3dcompiler_43/utils.c | 2 +- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 22cc41db56..ab712c8d96 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -1046,6 +1046,7 @@ struct hlsl_parse_ctx struct list types; struct wine_rb_tree functions; + const struct hlsl_ir_function_decl *cur_function; enum hlsl_matrix_majority matrix_majority; }; @@ -1138,6 +1139,8 @@ struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **ope struct source_location *loc) DECLSPEC_HIDDEN; struct hlsl_ir_expr *new_cast(struct hlsl_ir_node *node, struct hlsl_type *type, struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_type *type, + struct source_location *loc) DECLSPEC_HIDDEN; struct hlsl_ir_deref *new_var_deref(struct hlsl_ir_var *var) DECLSPEC_HIDDEN; struct hlsl_ir_deref *new_record_deref(struct hlsl_ir_node *record, struct hlsl_struct_field *field) DECLSPEC_HIDDEN; struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *left, enum parse_assign_op assign_op, diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 0f9676df16..34adab2855 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -492,13 +492,22 @@ static struct hlsl_ir_jump *new_return(struct hlsl_ir_node *value, struct source jump->node.type = HLSL_IR_JUMP; jump->node.loc = loc; jump->type = HLSL_IR_JUMP_RETURN; - jump->node.data_type = value ? value->data_type - : new_hlsl_type(d3dcompiler_strdup("void"), HLSL_CLASS_OBJECT, HLSL_TYPE_VOID, 1, 1); - jump->return_value = value; - - FIXME("Check for valued return on void function.\n"); - FIXME("Implicit conversion to the return type if needed, " - "error out if conversion not possible.\n"); + jump->node.data_type = hlsl_ctx.cur_function->return_type; + if (value) + { + if (!(jump->return_value = implicit_conversion(value, jump->node.data_type, &loc))) + { + d3dcompiler_free(jump); + return NULL; + } + } + else if (jump->node.data_type->base_type != HLSL_TYPE_VOID) + { + hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, + "non-void function must return a value"); + d3dcompiler_free(jump); + return NULL; + } return jump; } @@ -1336,6 +1345,7 @@ func_prototype: var_modifiers type var_identifier '(' parameters ')' c $$.name = $3; $$.decl->semantic = $7.semantic; set_location(&$$.decl->loc, &@3); + hlsl_ctx.cur_function = $$.decl; } compound_statement: '{' '}' diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index f1ce5dc5bc..c673e2be32 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -730,7 +730,7 @@ static void test_fail(void) compiled = errors = NULL; hr = ppD3DCompile(tests[i], strlen(tests[i]), NULL, NULL, NULL, "test", targets[j], 0, 0, &compiled, &errors); todo_wine ok(hr == E_FAIL, "Test %u, target %s, got unexpected hr %#x.\n", i, targets[j], hr); - todo_wine_if (i == 1 || i >= 7) ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]); + todo_wine_if (i == 1) ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]); ok(!compiled, "Test %u, target %s, expected no compiled shader blob.\n", i, targets[j]); if (errors) ID3D10Blob_Release(errors); diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 65f5ead333..28ec47423a 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1275,7 +1275,7 @@ static struct hlsl_type *expr_common_type(struct hlsl_type *t1, struct hlsl_type return new_hlsl_type(NULL, type, base, dimx, dimy); } -static struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_type *dst_type, +struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_type *dst_type, struct source_location *loc) { struct hlsl_type *src_type = node->data_type;
1
0
0
0
Zebediah Figura : d3dcompiler: Check for implicit type compatibility in implicit_conversion().
by Alexandre Julliard
03 Mar '20
03 Mar '20
Module: wine Branch: master Commit: 60f78a14769520f41a984d1abb3e5a38154080df URL:
https://source.winehq.org/git/wine.git/?a=commit;h=60f78a14769520f41a984d1a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 1 22:55:25 2020 -0600 d3dcompiler: Check for implicit type compatibility in implicit_conversion(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/utils.c | 60 ++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 5e497495e6..65f5ead333 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1275,16 +1275,31 @@ static struct hlsl_type *expr_common_type(struct hlsl_type *t1, struct hlsl_type return new_hlsl_type(NULL, type, base, dimx, dimy); } -static struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_type *type, +static struct hlsl_ir_node *implicit_conversion(struct hlsl_ir_node *node, struct hlsl_type *dst_type, struct source_location *loc) { + struct hlsl_type *src_type = node->data_type; struct hlsl_ir_expr *cast; - if (compare_hlsl_types(node->data_type, type)) + if (compare_hlsl_types(src_type, dst_type)) return node; - TRACE("Implicit conversion of expression to %s\n", debug_hlsl_type(type)); - if ((cast = new_cast(node, type, loc))) - list_add_after(&node->entry, &cast->node.entry); + + if (!implicit_compatible_data_types(src_type, dst_type)) + { + hlsl_report_message(loc->file, loc->line, loc->col, HLSL_LEVEL_ERROR, + "can't implicitly convert %s to %s", debug_hlsl_type(src_type), debug_hlsl_type(dst_type)); + return NULL; + } + + 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, + "implicit truncation of vector type"); + + TRACE("Implicit conversion from %s to %s.\n", debug_hlsl_type(src_type), debug_hlsl_type(dst_type)); + + if (!(cast = new_cast(node, dst_type, loc))) + return NULL; + list_add_after(&node->entry, &cast->node.entry); return &cast->node; } @@ -1316,6 +1331,8 @@ struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **ope } for (i = 0; i <= 2; ++i) { + struct hlsl_ir_expr *cast; + if (!operands[i]) break; if (compare_hlsl_types(operands[i]->data_type, type)) @@ -1328,13 +1345,14 @@ struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **ope operands[i]->loc.line, operands[i]->loc.col, HLSL_LEVEL_WARNING, "implicit truncation of vector/matrix type"); } - operands[i] = implicit_conversion(operands[i], type, &operands[i]->loc); - if (!operands[i]) + + if (!(cast = new_cast(operands[i], type, &operands[i]->loc))) { - ERR("Impossible to convert expression operand %u to %s\n", i + 1, debug_hlsl_type(type)); d3dcompiler_free(expr); return NULL; } + list_add_after(&operands[i]->entry, &cast->node.entry); + operands[i] = &cast->node; } expr->node.data_type = type; expr->op = op; @@ -1463,31 +1481,7 @@ struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *left, enum parse_assig lhs = left; /* FIXME: check for invalid writemasks on the lhs. */ - if (!compare_hlsl_types(type, rhs->data_type)) - { - struct hlsl_ir_node *converted_rhs; - - if (!implicit_compatible_data_types(rhs->data_type, type)) - { - hlsl_report_message(rhs->loc.file, rhs->loc.line, rhs->loc.col, HLSL_LEVEL_ERROR, - "can't implicitly convert %s to %s", - debug_hlsl_type(rhs->data_type), debug_hlsl_type(type)); - d3dcompiler_free(assign); - return NULL; - } - if (lhs->data_type->dimx * lhs->data_type->dimy < rhs->data_type->dimx * rhs->data_type->dimy) - hlsl_report_message(rhs->loc.file, rhs->loc.line, rhs->loc.col, HLSL_LEVEL_WARNING, - "implicit truncation of vector type"); - - converted_rhs = implicit_conversion(rhs, type, &rhs->loc); - if (!converted_rhs) - { - ERR("Couldn't implicitly convert expression to %s.\n", debug_hlsl_type(type)); - d3dcompiler_free(assign); - return NULL; - } - rhs = converted_rhs; - } + rhs = implicit_conversion(rhs, type, &rhs->loc); assign->lhs = lhs; if (assign_op != ASSIGN_OP_ASSIGN)
1
0
0
0
Zebediah Figura : d3dcompiler: Parse return statements without a value.
by Alexandre Julliard
03 Mar '20
03 Mar '20
Module: wine Branch: master Commit: e597b9e5554f05287377233233adc370449667d7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e597b9e5554f052873772332…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 1 22:55:24 2020 -0600 d3dcompiler: Parse return statements without a value. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/hlsl.y | 55 +++++++++++++++++++++++++---------- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 2 +- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index b6478bf3fe..0f9676df16 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -481,6 +481,28 @@ static struct hlsl_ir_swizzle *get_swizzle(struct hlsl_ir_node *value, const cha return NULL; } +static struct hlsl_ir_jump *new_return(struct hlsl_ir_node *value, struct source_location loc) +{ + struct hlsl_ir_jump *jump = d3dcompiler_alloc(sizeof(*jump)); + if (!jump) + { + ERR("Out of memory\n"); + return NULL; + } + jump->node.type = HLSL_IR_JUMP; + jump->node.loc = loc; + jump->type = HLSL_IR_JUMP_RETURN; + jump->node.data_type = value ? value->data_type + : new_hlsl_type(d3dcompiler_strdup("void"), HLSL_CLASS_OBJECT, HLSL_TYPE_VOID, 1, 1); + jump->return_value = value; + + FIXME("Check for valued return on void function.\n"); + FIXME("Implicit conversion to the return type if needed, " + "error out if conversion not possible.\n"); + + return jump; +} + static void struct_var_initializer(struct list *list, struct hlsl_ir_var *var, struct parse_initializer *initializer) { @@ -1769,28 +1791,31 @@ statement: declaration_statement | selection_statement | loop_statement - /* FIXME: add rule for return with no value */ jump_statement: KW_RETURN expr ';' { - struct hlsl_ir_jump *jump = d3dcompiler_alloc(sizeof(*jump)); - if (!jump) - { - ERR("Out of memory\n"); - YYABORT; - } - jump->node.type = HLSL_IR_JUMP; - set_location(&jump->node.loc, &@1); - jump->type = HLSL_IR_JUMP_RETURN; - jump->node.data_type = node_from_list($2)->data_type; - jump->return_value = node_from_list($2); + struct source_location loc; + struct hlsl_ir_jump *jump; - FIXME("Check for valued return on void function.\n"); - FIXME("Implicit conversion to the return type if needed, " - "error out if conversion not possible.\n"); + set_location(&loc, &@1); + if (!(jump = new_return(node_from_list($2), loc))) + YYABORT; $$ = $2; list_add_tail($$, &jump->node.entry); } + | KW_RETURN ';' + { + struct source_location loc; + struct hlsl_ir_jump *jump; + + set_location(&loc, &@1); + if (!(jump = new_return(NULL, loc))) + YYABORT; + + $$ = d3dcompiler_alloc(sizeof(*$$)); + list_init($$); + list_add_tail($$, &jump->node.entry); + } selection_statement: KW_IF '(' expr ')' if_body { diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index 062ef0a84a..f1ce5dc5bc 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -730,7 +730,7 @@ static void test_fail(void) compiled = errors = NULL; hr = ppD3DCompile(tests[i], strlen(tests[i]), NULL, NULL, NULL, "test", targets[j], 0, 0, &compiled, &errors); todo_wine ok(hr == E_FAIL, "Test %u, target %s, got unexpected hr %#x.\n", i, targets[j], hr); - todo_wine_if (i == 1 || i >= 8) ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]); + todo_wine_if (i == 1 || i >= 7) ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]); ok(!compiled, "Test %u, target %s, expected no compiled shader blob.\n", i, targets[j]); if (errors) ID3D10Blob_Release(errors);
1
0
0
0
Zebediah Figura : d3dcompiler/tests: Add some more tests for return statements.
by Alexandre Julliard
03 Mar '20
03 Mar '20
Module: wine Branch: master Commit: 8b08fec5e35e59a5fc4c7c0a904f61b208970125 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8b08fec5e35e59a5fc4c7c0a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 1 22:55:23 2020 -0600 d3dcompiler/tests: Add some more tests for return statements. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 68 ++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index 9bf3784c1d..062ef0a84a 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -604,6 +604,56 @@ static void test_comma(void) release_test_context(&test_context); } +static void test_return(void) +{ + struct test_context test_context; + ID3D10Blob *ps_code = NULL; + struct vec4 v; + + static const char *void_source = + "void main(float x : TEXCOORD0, out float4 ret : COLOR)\n" + "{\n" + " ret = float4(0.1, 0.2, 0.3, 0.4);\n" + " return;\n" + " ret = float4(0.5, 0.6, 0.7, 0.8);\n" + "}"; + + static const char *implicit_conversion_source = + "float4 main(float x : TEXCOORD0) : COLOR\n" + "{\n" + " return float2x2(0.4, 0.3, 0.2, 0.1);\n" + "}"; + + if (!init_test_context(&test_context)) + return; + + todo_wine ps_code = compile_shader(void_source, "ps_2_0"); + if (ps_code) + { + draw_quad(test_context.device, ps_code); + + v = get_color_vec4(test_context.device, 0, 0); + ok(compare_vec4(&v, 0.1f, 0.2f, 0.3f, 0.4f, 0), + "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w); + + ID3D10Blob_Release(ps_code); + } + + todo_wine ps_code = compile_shader(implicit_conversion_source, "ps_2_0"); + if (ps_code) + { + draw_quad(test_context.device, ps_code); + + v = get_color_vec4(test_context.device, 0, 0); + ok(compare_vec4(&v, 0.4f, 0.3f, 0.2f, 0.1f, 0), + "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w); + + ID3D10Blob_Release(ps_code); + } + + release_test_context(&test_context); +} + static void test_fail(void) { static const char *tests[] = @@ -650,6 +700,21 @@ static void test_fail(void) " struct {} x = {};\n" " return y;\n" "}", + + "float4 test(float2 pos : TEXCOORD0) : SV_TARGET\n" + "{\n" + " return;\n" + "}", + + "void test(float2 pos : TEXCOORD0)\n" + "{\n" + " return pos;\n" + "}", + + "float4 test(float2 pos : TEXCOORD0) : SV_TARGET\n" + "{\n" + " return pos;\n" + "}", }; static const char *targets[] = {"ps_2_0", "ps_3_0", "ps_4_0"}; @@ -665,7 +730,7 @@ static void test_fail(void) compiled = errors = NULL; hr = ppD3DCompile(tests[i], strlen(tests[i]), NULL, NULL, NULL, "test", targets[j], 0, 0, &compiled, &errors); todo_wine ok(hr == E_FAIL, "Test %u, target %s, got unexpected hr %#x.\n", i, targets[j], hr); - todo_wine_if (i == 1) ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]); + todo_wine_if (i == 1 || i >= 8) ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]); ok(!compiled, "Test %u, target %s, expected no compiled shader blob.\n", i, targets[j]); if (errors) ID3D10Blob_Release(errors); @@ -710,5 +775,6 @@ START_TEST(hlsl_d3d9) test_float_vectors(); test_trig(); test_comma(); + test_return(); test_fail(); }
1
0
0
0
Nikolay Sivov : mfplat: Implement transform activation object.
by Alexandre Julliard
03 Mar '20
03 Mar '20
Module: wine Branch: master Commit: 246382e8aadfab77919546b17a7d0a6d2ef705eb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=246382e8aadfab77919546b1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 3 15:46:05 2020 +0300 mfplat: Implement transform activation object. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index a1314f6eb3..09d6a63bba 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -109,6 +109,7 @@ struct transform_activate struct attributes attributes; IMFActivate IMFActivate_iface; IClassFactory *factory; + IMFTransform *transform; }; struct system_clock @@ -198,6 +199,8 @@ static ULONG WINAPI transform_activate_Release(IMFActivate *iface) clear_attributes_object(&activate->attributes); if (activate->factory) IClassFactory_Release(activate->factory); + if (activate->transform) + IMFTransform_Release(activate->transform); heap_free(activate); } @@ -482,21 +485,67 @@ static HRESULT WINAPI transform_activate_CopyAllItems(IMFActivate *iface, IMFAtt static HRESULT WINAPI transform_activate_ActivateObject(IMFActivate *iface, REFIID riid, void **obj) { - FIXME("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); + struct transform_activate *activate = impl_from_IMFActivate(iface); + CLSID clsid; + HRESULT hr; - return E_NOTIMPL; + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); + + EnterCriticalSection(&activate->attributes.cs); + + if (!activate->transform) + { + if (activate->factory) + { + if (FAILED(hr = IClassFactory_CreateInstance(activate->factory, NULL, &IID_IMFTransform, + (void **)&activate->transform))) + { + hr = MF_E_INVALIDREQUEST; + } + } + else + { + if (SUCCEEDED(hr = attributes_GetGUID(&activate->attributes, &MFT_TRANSFORM_CLSID_Attribute, &clsid))) + { + if (FAILED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, + (void **)&activate->transform))) + { + hr = MF_E_INVALIDREQUEST; + } + } + } + } + + if (activate->transform) + hr = IMFTransform_QueryInterface(activate->transform, riid, obj); + + LeaveCriticalSection(&activate->attributes.cs); + + return hr; } static HRESULT WINAPI transform_activate_ShutdownObject(IMFActivate *iface) { - FIXME("%p.\n", iface); + struct transform_activate *activate = impl_from_IMFActivate(iface); - return E_NOTIMPL; + TRACE("%p.\n", iface); + + EnterCriticalSection(&activate->attributes.cs); + + if (activate->transform) + { + IMFTransform_Release(activate->transform); + activate->transform = NULL; + } + + LeaveCriticalSection(&activate->attributes.cs); + + return S_OK; } static HRESULT WINAPI transform_activate_DetachObject(IMFActivate *iface) { - FIXME("%p.\n", iface); + TRACE("%p.\n", iface); return E_NOTIMPL; }
1
0
0
0
Nikolay Sivov : mfplat: Default to synchronous model for locally registered MFTs.
by Alexandre Julliard
03 Mar '20
03 Mar '20
Module: wine Branch: master Commit: 7d8640a7149bb411c052ebedf9b2abb24b8746ad URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7d8640a7149bb411c052ebed…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 3 12:22:45 2020 +0300 mfplat: Default to synchronous model for locally registered MFTs. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index d15bf00337..a1314f6eb3 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -97,6 +97,7 @@ struct mft_registration UINT32 input_types_count; MFT_REGISTER_TYPE_INFO *output_types; UINT32 output_types_count; + BOOL local; }; static CRITICAL_SECTION local_mfts_section = { NULL, -1, 0, 0, 0, 0 }; @@ -818,7 +819,10 @@ static HRESULT mft_register_local(IClassFactory *factory, REFCLSID clsid, REFGUI if (clsid) mft->clsid = *clsid; mft->category = *category; - mft->flags = flags | MFT_ENUM_FLAG_LOCALMFT; + if (!(flags & (MFT_ENUM_FLAG_SYNCMFT | MFT_ENUM_FLAG_ASYNCMFT | MFT_ENUM_FLAG_HARDWARE))) + flags |= MFT_ENUM_FLAG_SYNCMFT; + mft->flags = flags; + mft->local = TRUE; if (FAILED(hr = heap_strdupW(name, &mft->name))) goto failed; @@ -1198,6 +1202,7 @@ static HRESULT mft_enum(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INF if (mft->factory) IClassFactory_AddRef(mft->factory); mft->flags = local->flags; + mft->local = local->local; list_add_tail(&mfts, &mft->entry); } @@ -1213,7 +1218,7 @@ static HRESULT mft_enum(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INF /* Local registrations. */ LIST_FOR_EACH_ENTRY_SAFE(mft, mft2, &mfts, struct mft_registration, entry) { - if (mft->flags & MFT_ENUM_FLAG_LOCALMFT) + if (mft->local) { list_remove(&mft->entry); list_add_tail(&mfts_sorted, &mft->entry); @@ -1239,7 +1244,7 @@ static HRESULT mft_enum(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INF list_add_tail(&mfts_sorted, &mft->entry); } - result = &mfts; + result = &mfts_sorted; } IMFPluginControl_Release(plugin_control); @@ -1265,7 +1270,7 @@ static HRESULT mft_enum(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INF { (*activate)[obj_count] = mft_activate; - if (mft->flags & MFT_ENUM_FLAG_LOCALMFT) + if (mft->local) { IMFActivate_SetUINT32(mft_activate, &MFT_PROCESS_LOCAL_Attribute, 1); }
1
0
0
0
Nikolay Sivov : mfplat: Set activation object attributes for enumeration results.
by Alexandre Julliard
03 Mar '20
03 Mar '20
Module: wine Branch: master Commit: 089da73865590a55ae5e9c44728871799ad4af64 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=089da73865590a55ae5e9c44…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 3 12:22:44 2020 +0300 mfplat: Set activation object attributes for enumeration results. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index e63b8fb9c2..d15bf00337 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -1265,7 +1265,27 @@ static HRESULT mft_enum(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INF { (*activate)[obj_count] = mft_activate; - /* FIXME: set some attributes */ + if (mft->flags & MFT_ENUM_FLAG_LOCALMFT) + { + IMFActivate_SetUINT32(mft_activate, &MFT_PROCESS_LOCAL_Attribute, 1); + } + else + { + if (mft->name) + IMFActivate_SetString(mft_activate, &MFT_FRIENDLY_NAME_Attribute, mft->name); + if (mft->input_types) + IMFActivate_SetBlob(mft_activate, &MFT_INPUT_TYPES_Attributes, (const UINT8 *)mft->input_types, + sizeof(*mft->input_types) * mft->input_types_count); + if (mft->output_types) + IMFActivate_SetBlob(mft_activate, &MFT_OUTPUT_TYPES_Attributes, (const UINT8 *)mft->output_types, + sizeof(*mft->output_types) * mft->output_types_count); + } + + if (!mft->factory) + IMFActivate_SetGUID(mft_activate, &MFT_TRANSFORM_CLSID_Attribute, &mft->clsid); + + IMFActivate_SetUINT32(mft_activate, &MF_TRANSFORM_FLAGS_Attribute, mft->flags); + IMFActivate_SetGUID(mft_activate, &MF_TRANSFORM_CATEGORY_Attribute, &mft->category); obj_count++; }
1
0
0
0
Nikolay Sivov : mfplat: Add some MFT-related attributes GUIDs.
by Alexandre Julliard
03 Mar '20
03 Mar '20
Module: wine Branch: master Commit: 063e58fbaba7e279277e76140bbab6bb5656cf9f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=063e58fbaba7e279277e7614…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 3 12:22:43 2020 +0300 mfplat: Add some MFT-related attributes GUIDs. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 31 +++++++++++++++++++++++++++++++ include/mfapi.h | 3 +++ include/mfidl.idl | 2 ++ include/mftransform.idl | 25 +++++++++++++++++++++++++ 4 files changed, 61 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=063e58fbaba7e279277e…
1
0
0
0
Nikolay Sivov : mfplat: Implement MFTEnumEx().
by Alexandre Julliard
03 Mar '20
03 Mar '20
Module: wine Branch: master Commit: c0b1d7b593198bb8f34cd3d98188012b98ebd0b6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c0b1d7b593198bb8f34cd3d9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 3 12:22:42 2020 +0300 mfplat: Implement MFTEnumEx(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 457 ++++++++++++++++++++++++++++++++++++--------- dlls/mfplat/mfplat.spec | 1 + dlls/mfplat/tests/mfplat.c | 17 +- include/mfapi.h | 2 + 4 files changed, 391 insertions(+), 86 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c0b1d7b593198bb8f34c…
1
0
0
0
← Newer
1
...
92
93
94
95
96
97
98
99
100
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Results per page:
10
25
50
100
200