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
June 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
947 discussions
Start a n
N
ew thread
Nikolay Sivov : mfmediaengine: Set media type flags on source resolution.
by Alexandre Julliard
03 Jun '20
03 Jun '20
Module: wine Branch: master Commit: c1a12f10b34c7f78e7f5f50a78a80f7db5a74ddd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c1a12f10b34c7f78e7f5f50a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 3 20:08:38 2020 +0300 mfmediaengine: Set media type flags on source resolution. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfmediaengine/main.c | 203 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 193 insertions(+), 10 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c1a12f10b34c7f78e7f5…
1
0
0
0
Nikolay Sivov : include: Add more Media Foundation error codes.
by Alexandre Julliard
03 Jun '20
03 Jun '20
Module: wine Branch: master Commit: 04c2df85cb766d535f1522e162f2780043d305ac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=04c2df85cb766d535f1522e1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 3 20:08:37 2020 +0300 include: Add more Media Foundation error codes. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/mferror.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/mferror.h b/include/mferror.h index 523800d7f0..28910d2568 100644 --- a/include/mferror.h +++ b/include/mferror.h @@ -77,12 +77,28 @@ #define MF_E_DISABLED_IN_SAFEMODE _HRESULT_TYPEDEF_(0xc00d36ef) #define MF_E_CANNOT_PARSE_BYTESTREAM _HRESULT_TYPEDEF_(0xc00d36f0) #define MF_E_SOURCERESOLVER_MUTUALLY_EXCLUSIVE_FLAGS _HRESULT_TYPEDEF_(0xc00d36f1) +#define MF_E_CANNOT_CREATE_SINK _HRESULT_TYPEDEF_(0xc00d36fa) #define MF_E_BYTESTREAM_UNKNOWN_LENGTH _HRESULT_TYPEDEF_(0xc00d36fb) +#define MF_E_SESSION_PAUSEWHILESTOPPED _HRESULT_TYPEDEF_(0xc00d36fc) +#define MF_S_ACTIVATE_REPLACED _HRESULT_TYPEDEF_(0x000d36fd) +#define MF_E_FORMAT_CHANGE_NOT_SUPPORTED _HRESULT_TYPEDEF_(0xc00d36fe) #define MF_E_INVALID_WORKQUEUE _HRESULT_TYPEDEF_(0xc00d36ff) +#define MF_E_DRM_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d3700) +#define MF_E_UNAUTHORIZED _HRESULT_TYPEDEF_(0xc00d3701) +#define MF_E_OUT_OF_RANGE _HRESULT_TYPEDEF_(0xc00d3702) +#define MF_E_INVALID_CODEC_MERIT _HRESULT_TYPEDEF_(0xc00d3703) +#define MF_E_HW_MFT_FAILED_START_STREAMING _HRESULT_TYPEDEF_(0xc00d3704) +#define MF_E_OPERATION_IN_PROGRESS _HRESULT_TYPEDEF_(0xc00d3705) +#define MF_E_HARDWARE_DRM_UNSUPPORTED _HRESULT_TYPEDEF_(0xc00d3706) +#define MF_E_DURATION_TOO_LONG _HRESULT_TYPEDEF_(0xc00d3707) #define MF_E_NO_EVENTS_AVAILABLE _HRESULT_TYPEDEF_(0xc00d3e80) #define MF_E_INVALID_STATE_TRANSITION _HRESULT_TYPEDEF_(0xc00d3e82) #define MF_E_END_OF_STREAM _HRESULT_TYPEDEF_(0xc00d3e84) #define MF_E_SHUTDOWN _HRESULT_TYPEDEF_(0xc00d3e85) +#define MF_E_MP3_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d3e86) +#define MF_E_MP3_OUT_OF_DATA _HRESULT_TYPEDEF_(0xc00d3e87) +#define MF_E_MP3_NOTMP3 _HRESULT_TYPEDEF_(0xc00d3e88) +#define MF_E_MP3_NOTSUPPORTED _HRESULT_TYPEDEF_(0xc00d3e89) #define MF_E_NO_DURATION _HRESULT_TYPEDEF_(0xc00d3e8a) #define MF_E_INVALID_FORMAT _HRESULT_TYPEDEF_(0xc00d3e8c) #define MF_E_PROPERTY_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d3e8d) @@ -90,9 +106,17 @@ #define MF_E_PROPERTY_NOT_ALLOWED _HRESULT_TYPEDEF_(0xc00d3e8f) #define MF_E_MEDIA_SOURCE_NOT_STARTED _HRESULT_TYPEDEF_(0xc00d3e91) #define MF_E_UNSUPPORTED_FORMAT _HRESULT_TYPEDEF_(0xc00d3e98) +#define MF_E_MP3_BAD_CRC _HRESULT_TYPEDEF_(0xc00d3e99) +#define MF_E_NOT_PROTECTED _HRESULT_TYPEDEF_(0xc00d3e9a) #define MF_E_MEDIA_SOURCE_WRONGSTATE _HRESULT_TYPEDEF_(0xc00d3e9b) #define MF_E_MEDIA_SOURCE_NO_STREAMS_SELECTED _HRESULT_TYPEDEF_(0xc00d3e9c) +#define MF_E_CANNOT_FIND_KEYFRAME_SAMPLE _HRESULT_TYPEDEF_(0xc00d3e9d) #define MF_E_UNSUPPORTED_CHARACTERISTICS _HRESULT_TYPEDEF_(0xc00d3e9e) +#define MF_E_NO_AUDIO_RECORDING_DEVICE _HRESULT_TYPEDEF_(0xc00d3e9f) +#define MF_E_AUDIO_RECORDING_DEVICE_IN_USE _HRESULT_TYPEDEF_(0xc00d3ea0) +#define MF_E_AUDIO_RECORDING_DEVICE_INVALIDATED _HRESULT_TYPEDEF_(0xc00d3ea1) +#define MF_E_VIDEO_RECORDING_DEVICE_INVALIDATED _HRESULT_TYPEDEF_(0xc00d3ea2) +#define MF_E_VIDEO_RECORDING_DEVICE_PREEMPTED _HRESULT_TYPEDEF_(0xc00d3ea3) #define MF_E_STREAMSINK_REMOVED _HRESULT_TYPEDEF_(0xc00d4a38) #define MF_E_STREAMSINKS_OUT_OF_SYNC _HRESULT_TYPEDEF_(0xc00d4a3a)
1
0
0
0
Zebediah Figura : d3dcompiler: Write to the function return value using a separate instruction.
by Alexandre Julliard
03 Jun '20
03 Jun '20
Module: wine Branch: master Commit: 513f0def41f05dacc0b3894e33d045529bd39964 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=513f0def41f05dacc0b3894e…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jun 1 17:58:46 2020 -0500 d3dcompiler: Write to the function return value using a separate instruction. 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 | 2 +- dlls/d3dcompiler_43/hlsl.y | 92 ++++++++++++++++++------------- dlls/d3dcompiler_43/utils.c | 5 +- 3 files changed, 55 insertions(+), 44 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index bc2e43cfff..a61b84d6b5 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -722,6 +722,7 @@ struct hlsl_ir_function struct hlsl_ir_function_decl { struct hlsl_type *return_type; + struct hlsl_ir_var *return_var; struct source_location loc; struct wine_rb_entry entry; struct hlsl_ir_function *func; @@ -832,7 +833,6 @@ struct hlsl_ir_jump { struct hlsl_ir_node node; enum hlsl_ir_jump_type type; - struct hlsl_ir_node *return_value; }; struct hlsl_ir_swizzle diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 70ffa70fe1..1797996ddb 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -507,35 +507,6 @@ 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_type *return_type = hlsl_ctx.cur_function->return_type; - struct hlsl_ir_jump *jump = d3dcompiler_alloc(sizeof(*jump)); - if (!jump) - { - ERR("Out of memory\n"); - return NULL; - } - init_node(&jump->node, HLSL_IR_JUMP, NULL, loc); - jump->type = HLSL_IR_JUMP_RETURN; - if (value) - { - if (!(jump->return_value = implicit_conversion(value, return_type, &loc))) - { - d3dcompiler_free(jump); - return NULL; - } - } - else if (!type_is_void(return_type)) - { - hlsl_report_message(loc, HLSL_LEVEL_ERROR, "non-void function must return a value"); - d3dcompiler_free(jump); - return NULL; - } - - return jump; -} - static struct hlsl_ir_var *new_synthetic_var(const char *name, struct hlsl_type *type, const struct source_location loc) { @@ -578,6 +549,39 @@ static struct hlsl_ir_assignment *make_simple_assignment(struct hlsl_ir_var *lhs return new_assignment(lhs, NULL, rhs, 0, rhs->loc); } +static struct hlsl_ir_jump *new_return(struct hlsl_ir_node *return_value, struct source_location loc) +{ + struct hlsl_type *return_type = hlsl_ctx.cur_function->return_type; + struct hlsl_ir_jump *jump; + + if (return_value) + { + struct hlsl_ir_assignment *assignment; + + if (!(return_value = implicit_conversion(return_value, return_type, &loc))) + return NULL; + + if (!(assignment = make_simple_assignment(hlsl_ctx.cur_function->return_var, return_value))) + return NULL; + list_add_after(&return_value->entry, &assignment->node.entry); + } + else if (!type_is_void(return_type)) + { + hlsl_report_message(loc, HLSL_LEVEL_ERROR, "non-void function must return a value"); + return NULL; + } + + if (!(jump = d3dcompiler_alloc(sizeof(*jump)))) + { + ERR("Out of memory\n"); + return NULL; + } + init_node(&jump->node, HLSL_IR_JUMP, NULL, loc); + jump->type = HLSL_IR_JUMP_RETURN; + + return jump; +} + static struct hlsl_ir_constant *new_uint_constant(unsigned int n, const struct source_location loc) { struct hlsl_ir_constant *c; @@ -1264,6 +1268,21 @@ static struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type decl->parameters = parameters; decl->semantic = semantic; decl->loc = loc; + + if (!type_is_void(return_type)) + { + struct hlsl_ir_var *return_var; + char name[28]; + + sprintf(name, "<retval-%p>", decl); + if (!(return_var = new_synthetic_var(name, return_type, loc))) + { + d3dcompiler_free(decl); + return NULL; + } + decl->return_var = return_var; + } + return decl; } @@ -2818,8 +2837,6 @@ static void compute_liveness_recurse(struct list *instrs, unsigned int loop_firs assignment->lhs.offset->last_read = instr->index; break; } - case HLSL_IR_CONSTANT: - break; case HLSL_IR_CONSTRUCTOR: { struct hlsl_ir_constructor *constructor = constructor_from_node(instr); @@ -2847,13 +2864,6 @@ static void compute_liveness_recurse(struct list *instrs, unsigned int loop_firs iff->condition->last_read = instr->index; break; } - case HLSL_IR_JUMP: - { - struct hlsl_ir_jump *jump = jump_from_node(instr); - if (jump->type == HLSL_IR_JUMP_RETURN && jump->return_value) - jump->return_value->last_read = instr->index; - break; - } case HLSL_IR_LOAD: { struct hlsl_ir_load *load = load_from_node(instr); @@ -2876,7 +2886,8 @@ static void compute_liveness_recurse(struct list *instrs, unsigned int loop_firs swizzle->val->last_read = instr->index; break; } - default: + case HLSL_IR_CONSTANT: + case HLSL_IR_JUMP: break; } } @@ -2899,6 +2910,9 @@ static void compute_liveness(struct hlsl_ir_function_decl *entry_func) var->last_read = UINT_MAX; } + if (entry_func->return_var) + entry_func->return_var->last_read = UINT_MAX; + compute_liveness_recurse(entry_func->body, 0, 0); } diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 4fdda3513f..60bb5ff814 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -2039,10 +2039,7 @@ static void debug_dump_ir_jump(const struct hlsl_ir_jump *jump) wine_dbg_printf("discard"); break; case HLSL_IR_JUMP_RETURN: - wine_dbg_printf("return "); - if (jump->return_value) - debug_dump_src(jump->return_value); - wine_dbg_printf(";"); + wine_dbg_printf("return"); break; } }
1
0
0
0
Zebediah Figura : d3dcompiler: Also check the type class when checking for void.
by Alexandre Julliard
03 Jun '20
03 Jun '20
Module: wine Branch: master Commit: 2b77cfb7be73c08a406046bc3d0ea250c4743388 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2b77cfb7be73c08a406046bc…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jun 1 17:58:45 2020 -0500 d3dcompiler: Also check the type class when checking for void. As of 867fe22346, non-void types may have a base_type of HLSL_TYPE_VOID. 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 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index bf0160e369..70ffa70fe1 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -278,6 +278,11 @@ static void declare_predefined_types(struct hlsl_scope *scope) add_type_to_scope(scope, type); } +static BOOL type_is_void(const struct hlsl_type *type) +{ + return type->type == HLSL_CLASS_OBJECT && type->base_type == HLSL_TYPE_VOID; +} + static BOOL append_conditional_break(struct list *cond_list) { struct hlsl_ir_node *condition, *not; @@ -521,7 +526,7 @@ static struct hlsl_ir_jump *new_return(struct hlsl_ir_node *value, struct source return NULL; } } - else if (return_type->base_type != HLSL_TYPE_VOID) + else if (!type_is_void(return_type)) { hlsl_report_message(loc, HLSL_LEVEL_ERROR, "non-void function must return a value"); d3dcompiler_free(jump); @@ -1482,7 +1487,7 @@ hlsl_prog: /* empty */ } } - if ($2.decl->return_type->base_type == HLSL_TYPE_VOID && $2.decl->semantic) + if (type_is_void($2.decl->return_type) && $2.decl->semantic) { hlsl_report_message($2.decl->loc, HLSL_LEVEL_ERROR, "void function with a semantic"); @@ -1651,7 +1656,7 @@ func_prototype: var_modifiers type var_identifier '(' parameters ')' c HLSL_LEVEL_ERROR, "redefinition of '%s'\n", $3); YYABORT; } - if ($2->base_type == HLSL_TYPE_VOID && $7.semantic) + if (type_is_void($2) && $7.semantic) { hlsl_report_message(get_location(&@7), HLSL_LEVEL_ERROR, "void function with a semantic");
1
0
0
0
Zebediah Figura : d3dcompiler: Pass the semantic and location parameters to new_func_decl().
by Alexandre Julliard
03 Jun '20
03 Jun '20
Module: wine Branch: master Commit: c7b90bf3483ef4d926c0c3a5fdc6d7999d1e3302 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c7b90bf3483ef4d926c0c3a5…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jun 1 17:58:44 2020 -0500 d3dcompiler: Pass the semantic and location parameters to new_func_decl(). 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 | 1 - dlls/d3dcompiler_43/hlsl.y | 19 +++++++++++++++---- dlls/d3dcompiler_43/utils.c | 16 ---------------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 8e96a4fbca..bc2e43cfff 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -1096,7 +1096,6 @@ struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *left, enum parse_assig struct hlsl_ir_node *right) DECLSPEC_HIDDEN; void push_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN; BOOL pop_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN; -struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type, struct list *parameters) DECLSPEC_HIDDEN; void init_functions_tree(struct wine_rb_tree *funcs) DECLSPEC_HIDDEN; void add_function_decl(struct wine_rb_tree *funcs, char *name, struct hlsl_ir_function_decl *decl, BOOL intrinsic) DECLSPEC_HIDDEN; diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 19e7dd7aeb..bf0160e369 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -1248,6 +1248,20 @@ static unsigned int evaluate_array_dimension(struct hlsl_ir_node *node) } } +static struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type, + struct list *parameters, const char *semantic, struct source_location loc) +{ + struct hlsl_ir_function_decl *decl; + + if (!(decl = d3dcompiler_alloc(sizeof(*decl)))) + return NULL; + decl->return_type = return_type; + decl->parameters = parameters; + decl->semantic = semantic; + decl->loc = loc; + return decl; +} + %} %locations @@ -1648,15 +1662,12 @@ func_prototype: var_modifiers type var_identifier '(' parameters ')' c FIXME("Unexpected register reservation for a function.\n"); d3dcompiler_free($7.reg_reservation); } - $$.decl = new_func_decl($2, $5); - if (!$$.decl) + if (!($$.decl = new_func_decl($2, $5, $7.semantic, get_location(&@3)))) { ERR("Out of memory.\n"); YYABORT; } $$.name = $3; - $$.decl->semantic = $7.semantic; - $$.decl->loc = get_location(&@3); hlsl_ctx.cur_function = $$.decl; } diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 440ad49188..4fdda3513f 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1587,22 +1587,6 @@ BOOL pop_scope(struct hlsl_parse_ctx *ctx) return TRUE; } -struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type, struct list *parameters) -{ - struct hlsl_ir_function_decl *decl; - - decl = d3dcompiler_alloc(sizeof(*decl)); - if (!decl) - { - ERR("Out of memory.\n"); - return NULL; - } - decl->return_type = return_type; - decl->parameters = parameters; - - return decl; -} - static int compare_param_hlsl_types(const struct hlsl_type *t1, const struct hlsl_type *t2) { if (t1->type != t2->type)
1
0
0
0
Zebediah Figura : d3dcompiler: Create assignment instructions more directly in struct_var_initializer().
by Alexandre Julliard
03 Jun '20
03 Jun '20
Module: wine Branch: master Commit: 5900f00148148d919f5ed03161379b51f6f11c16 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5900f00148148d919f5ed031…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jun 1 17:58:43 2020 -0500 d3dcompiler: Create assignment instructions more directly in struct_var_initializer(). In particular so that we can remove the need for creating a load instruction, which besides being unnecessary was also never added to any instruction lists. 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 | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index f94e9a6462..19e7dd7aeb 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -549,22 +549,30 @@ static struct hlsl_ir_var *new_synthetic_var(const char *name, struct hlsl_type return var; } -static struct hlsl_ir_assignment *make_simple_assignment(struct hlsl_ir_var *lhs, struct hlsl_ir_node *rhs) +static struct hlsl_ir_assignment *new_assignment(struct hlsl_ir_var *var, struct hlsl_ir_node *offset, + struct hlsl_ir_node *rhs, unsigned int writemask, struct source_location loc) { struct hlsl_ir_assignment *assign; + if (!writemask && type_is_single_reg(rhs->data_type)) + writemask = (1 << rhs->data_type->dimx) - 1; + if (!(assign = d3dcompiler_alloc(sizeof(*assign)))) return NULL; - init_node(&assign->node, HLSL_IR_ASSIGNMENT, rhs->data_type, rhs->loc); - assign->lhs.var = lhs; + init_node(&assign->node, HLSL_IR_ASSIGNMENT, NULL, loc); + assign->lhs.var = var; + assign->lhs.offset = offset; assign->rhs = rhs; - if (type_is_single_reg(lhs->data_type)) - assign->writemask = (1 << lhs->data_type->dimx) - 1; - + assign->writemask = writemask; return assign; } +static struct hlsl_ir_assignment *make_simple_assignment(struct hlsl_ir_var *lhs, struct hlsl_ir_node *rhs) +{ + return new_assignment(lhs, NULL, rhs, 0, rhs->loc); +} + static struct hlsl_ir_constant *new_uint_constant(unsigned int n, const struct source_location loc) { struct hlsl_ir_constant *c; @@ -693,8 +701,6 @@ static void struct_var_initializer(struct list *list, struct hlsl_ir_var *var, { struct hlsl_type *type = var->data_type; struct hlsl_struct_field *field; - struct hlsl_ir_node *assignment; - struct hlsl_ir_load *load; unsigned int i = 0; if (initializer_size(initializer) != components_count_type(type)) @@ -710,22 +716,21 @@ static void struct_var_initializer(struct list *list, struct hlsl_ir_var *var, LIST_FOR_EACH_ENTRY(field, type->e.elements, struct hlsl_struct_field, entry) { struct hlsl_ir_node *node = initializer->args[i]; + struct hlsl_ir_assignment *assign; + struct hlsl_ir_constant *c; if (i++ >= initializer->args_count) - { - d3dcompiler_free(initializer->args); - return; - } + break; + if (components_count_type(field->type) == components_count_type(node->data_type)) { - if (!(load = new_record_load(&new_var_load(var, var->loc)->node, field, node->loc))) - { - ERR("Out of memory.\n"); + if (!(c = new_uint_constant(field->reg_offset * 4, node->loc))) break; - } - list_add_tail(list, &load->node.entry); - assignment = make_assignment(&load->node, ASSIGN_OP_ASSIGN, node); - list_add_tail(list, &assignment->entry); + list_add_tail(list, &c->node.entry); + + if (!(assign = new_assignment(var, &c->node, node, 0, node->loc))) + break; + list_add_tail(list, &assign->node.entry); } else FIXME("Initializing with \"mismatched\" fields is not supported yet.\n");
1
0
0
0
Zebediah Figura : d3dcompiler: Don't add a record deref to the instruction list twice.
by Alexandre Julliard
03 Jun '20
03 Jun '20
Module: wine Branch: master Commit: 7fc0b9a6bd63bdfaccbcb363018eaa99853d8b7d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7fc0b9a6bd63bdfaccbcb363…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jun 1 17:58:42 2020 -0500 d3dcompiler: Don't add a record deref to the instruction list twice. 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 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 236fc8c186..f94e9a6462 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -2323,14 +2323,9 @@ postfix_expr: primary_expr { if (!strcmp($3, field->name)) { - struct hlsl_ir_load *load = new_record_load(node, field, loc); - - if (!load) - { - ERR("Out of memory\n"); + if (!new_record_load(node, field, loc)) YYABORT; - } - $$ = append_unop($1, &load->node); + $$ = $1; break; } }
1
0
0
0
Zebediah Figura : d3dcompiler: Store some builtin types in the hlsl_ctx structure.
by Alexandre Julliard
03 Jun '20
03 Jun '20
Module: wine Branch: master Commit: 2449ff4b8f6fe4e0c76f3b5d29f082dbac5a8f6e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2449ff4b8f6fe4e0c76f3b5d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jun 1 17:58:41 2020 -0500 d3dcompiler: Store some builtin types in the hlsl_ctx structure. 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 | 8 ++ dlls/d3dcompiler_43/hlsl.y | 131 +++++++++++++++--------------- 2 files changed, 75 insertions(+), 64 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 6c2f234c4d..8e96a4fbca 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -595,6 +595,7 @@ enum hlsl_sampler_dim HLSL_SAMPLER_DIM_2D, HLSL_SAMPLER_DIM_3D, HLSL_SAMPLER_DIM_CUBE, + HLSL_SAMPLER_DIM_MAX = HLSL_SAMPLER_DIM_CUBE }; enum hlsl_matrix_majority @@ -983,6 +984,13 @@ struct hlsl_parse_ctx const struct hlsl_ir_function_decl *cur_function; enum hlsl_matrix_majority matrix_majority; + + struct + { + struct hlsl_type *scalar[HLSL_TYPE_LAST_SCALAR + 1]; + struct hlsl_type *sampler[HLSL_SAMPLER_DIM_MAX + 1]; + struct hlsl_type *Void; + } builtin_types; }; extern struct hlsl_parse_ctx hlsl_ctx DECLSPEC_HIDDEN; diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 058a627dc2..236fc8c186 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -213,6 +213,15 @@ static void declare_predefined_types(struct hlsl_scope *scope) }; char name[10]; + static const char *const sampler_names[] = + { + "sampler", + "sampler1D", + "sampler2D", + "sampler3D", + "samplerCUBE" + }; + for (bt = 0; bt <= HLSL_TYPE_LAST_SCALAR; ++bt) { for (y = 1; y <= 4; ++y) @@ -234,12 +243,22 @@ static void declare_predefined_types(struct hlsl_scope *scope) sprintf(name, "%s", names[bt]); type = new_hlsl_type(d3dcompiler_strdup(name), HLSL_CLASS_SCALAR, bt, x, y); add_type_to_scope(scope, type); + hlsl_ctx.builtin_types.scalar[bt] = type; } } } } } + for (bt = 0; bt <= HLSL_SAMPLER_DIM_MAX; ++bt) + { + type = new_hlsl_type(d3dcompiler_strdup(sampler_names[bt]), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); + type->sampler_dim = bt; + hlsl_ctx.builtin_types.sampler[bt] = type; + } + + hlsl_ctx.builtin_types.Void = new_hlsl_type(d3dcompiler_strdup("void"), HLSL_CLASS_OBJECT, HLSL_TYPE_VOID, 1, 1); + /* DX8 effects predefined types */ type = new_hlsl_type(d3dcompiler_strdup("DWORD"), HLSL_CLASS_SCALAR, HLSL_TYPE_INT, 1, 1); add_type_to_scope(scope, type); @@ -548,15 +567,11 @@ static struct hlsl_ir_assignment *make_simple_assignment(struct hlsl_ir_var *lhs static struct hlsl_ir_constant *new_uint_constant(unsigned int n, const struct source_location loc) { - struct hlsl_type *type; struct hlsl_ir_constant *c; - if (!(type = new_hlsl_type(d3dcompiler_strdup("uint"), HLSL_CLASS_SCALAR, HLSL_TYPE_UINT, 1, 1))) - return NULL; - if (!(c = d3dcompiler_alloc(sizeof(*c)))) return NULL; - init_node(&c->node, HLSL_IR_CONSTANT, type, loc); + init_node(&c->node, HLSL_IR_CONSTANT, hlsl_ctx.builtin_types.scalar[HLSL_TYPE_UINT], loc); c->v.value.u[0] = n; return c; } @@ -1814,60 +1829,48 @@ type: base_type $$ = new_hlsl_type(NULL, HLSL_CLASS_MATRIX, $3->base_type, $5, $7); } -base_type: KW_VOID - { - $$ = new_hlsl_type(d3dcompiler_strdup("void"), HLSL_CLASS_OBJECT, HLSL_TYPE_VOID, 1, 1); - } - | KW_SAMPLER - { - $$ = new_hlsl_type(d3dcompiler_strdup("sampler"), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); - $$->sampler_dim = HLSL_SAMPLER_DIM_GENERIC; - } - | KW_SAMPLER1D - { - $$ = new_hlsl_type(d3dcompiler_strdup("sampler1D"), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); - $$->sampler_dim = HLSL_SAMPLER_DIM_1D; - } - | KW_SAMPLER2D - { - $$ = new_hlsl_type(d3dcompiler_strdup("sampler2D"), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); - $$->sampler_dim = HLSL_SAMPLER_DIM_2D; - } - | KW_SAMPLER3D - { - $$ = new_hlsl_type(d3dcompiler_strdup("sampler3D"), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); - $$->sampler_dim = HLSL_SAMPLER_DIM_3D; - } - | KW_SAMPLERCUBE - { - $$ = new_hlsl_type(d3dcompiler_strdup("samplerCUBE"), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); - $$->sampler_dim = HLSL_SAMPLER_DIM_CUBE; - } - | TYPE_IDENTIFIER - { - struct hlsl_type *type; +base_type: - type = get_type(hlsl_ctx.cur_scope, $1, TRUE); - $$ = type; - d3dcompiler_free($1); - } - | KW_STRUCT TYPE_IDENTIFIER - { - struct hlsl_type *type; - - type = get_type(hlsl_ctx.cur_scope, $2, TRUE); - if (type->type != HLSL_CLASS_STRUCT) - { - hlsl_message("Line %u: redefining %s as a structure.\n", - hlsl_ctx.line_no, $2); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - } - else - { - $$ = type; - } - d3dcompiler_free($2); - } + KW_VOID + { + $$ = hlsl_ctx.builtin_types.Void; + } + | KW_SAMPLER + { + $$ = hlsl_ctx.builtin_types.sampler[HLSL_SAMPLER_DIM_GENERIC]; + } + | KW_SAMPLER1D + { + $$ = hlsl_ctx.builtin_types.sampler[HLSL_SAMPLER_DIM_1D]; + } + | KW_SAMPLER2D + { + $$ = hlsl_ctx.builtin_types.sampler[HLSL_SAMPLER_DIM_2D]; + } + | KW_SAMPLER3D + { + $$ = hlsl_ctx.builtin_types.sampler[HLSL_SAMPLER_DIM_3D]; + } + | KW_SAMPLERCUBE + { + $$ = hlsl_ctx.builtin_types.sampler[HLSL_SAMPLER_DIM_3D]; + } + | TYPE_IDENTIFIER + { + $$ = get_type(hlsl_ctx.cur_scope, $1, TRUE); + d3dcompiler_free($1); + } + | KW_STRUCT TYPE_IDENTIFIER + { + $$ = get_type(hlsl_ctx.cur_scope, $2, TRUE); + if ($$->type != HLSL_CLASS_STRUCT) + { + hlsl_message("Line %u: redefining %s as a structure.\n", + hlsl_ctx.line_no, $2); + set_parse_status(&hlsl_ctx.status, PARSE_ERR); + } + d3dcompiler_free($2); + } declaration_statement: declaration | struct_declaration @@ -2207,8 +2210,8 @@ primary_expr: C_FLOAT ERR("Out of memory.\n"); YYABORT; } - init_node(&c->node, HLSL_IR_CONSTANT, new_hlsl_type(d3dcompiler_strdup("float"), - HLSL_CLASS_SCALAR, HLSL_TYPE_FLOAT, 1, 1), get_location(&@1)); + init_node(&c->node, HLSL_IR_CONSTANT, + hlsl_ctx.builtin_types.scalar[HLSL_TYPE_FLOAT], get_location(&@1)); c->v.value.f[0] = $1; if (!($$ = make_list(&c->node))) YYABORT; @@ -2221,8 +2224,8 @@ primary_expr: C_FLOAT ERR("Out of memory.\n"); YYABORT; } - init_node(&c->node, HLSL_IR_CONSTANT, new_hlsl_type(d3dcompiler_strdup("int"), - HLSL_CLASS_SCALAR, HLSL_TYPE_INT, 1, 1), get_location(&@1)); + init_node(&c->node, HLSL_IR_CONSTANT, + hlsl_ctx.builtin_types.scalar[HLSL_TYPE_INT], get_location(&@1)); c->v.value.i[0] = $1; if (!($$ = make_list(&c->node))) YYABORT; @@ -2235,8 +2238,8 @@ primary_expr: C_FLOAT ERR("Out of memory.\n"); YYABORT; } - init_node(&c->node, HLSL_IR_CONSTANT, new_hlsl_type(d3dcompiler_strdup("bool"), - HLSL_CLASS_SCALAR, HLSL_TYPE_BOOL, 1, 1), get_location(&@1)); + init_node(&c->node, HLSL_IR_CONSTANT, + hlsl_ctx.builtin_types.scalar[HLSL_TYPE_BOOL], get_location(&@1)); c->v.value.b[0] = $1; if (!($$ = make_list(&c->node))) YYABORT;
1
0
0
0
Ziqing Hui : windowscodecs: Add tests for DdsFrameDecode_Dds_CopyBlocks().
by Alexandre Julliard
03 Jun '20
03 Jun '20
Module: wine Branch: master Commit: b3eabfdd93ae867075ad8a4b8edc21438379c987 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b3eabfdd93ae867075ad8a4b…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Wed Jun 3 18:45:57 2020 +0800 windowscodecs: Add tests for DdsFrameDecode_Dds_CopyBlocks(). Some code in test_dds_decoder_frame_properties() are moved to test_dds_decoder_frame() bacause there are some same code in test_dds_decoder_frame_properties() and test_dds_decoder_frame_data(). Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Esme Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/tests/ddsformat.c | 124 ++++++++++++++++++++++++++--------- 1 file changed, 93 insertions(+), 31 deletions(-) diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c index 9b14bed52c..327701f22c 100644 --- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -121,7 +121,7 @@ static BYTE test_dds_array[] = { }; static struct test_data { - void *data; + BYTE *data; UINT size; UINT expected_frame_count; WICDdsParameters expected_parameters; @@ -212,6 +212,11 @@ static UINT get_bytes_per_block(DXGI_FORMAT format) } } +static BOOL has_extended_header(const BYTE *data) +{ + return data[84] == 'D' && data[85] == 'X' && data[86] == '1' && data[87] == '0'; +} + static void test_dds_decoder_initialize(void) { static BYTE test_dds_bad_magic[sizeof(test_dds_image)]; @@ -387,27 +392,14 @@ static void test_dds_decoder_image_parameters(void) } } -static void test_dds_decoder_frame_properties(IWICBitmapDecoder *decoder, IWICBitmapFrameDecode *frame_decode, - UINT frame_count, int i, int frame_index) +static void test_dds_decoder_frame_properties(IWICBitmapFrameDecode *frame_decode, IWICDdsFrameDecode *dds_frame, + UINT frame_count, WICDdsParameters *params, int i, int frame_index) { HRESULT hr; - WICDdsParameters params; - IWICDdsDecoder *dds_decoder = NULL; - IWICDdsFrameDecode *dds_frame = NULL; UINT width, height ,expected_width, expected_height, slice_index, depth; UINT width_in_blocks, height_in_blocks, expected_width_in_blocks, expected_height_in_blocks; WICDdsFormatInfo format_info; - hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder); - ok(hr == S_OK, "%d: QueryInterface failed, hr=%x\n", i, hr); - if (hr != S_OK) goto end; - hr = IWICBitmapFrameDecode_QueryInterface(frame_decode, &IID_IWICDdsFrameDecode, (void **)&dds_frame); - ok(hr == S_OK, "%d: [frame %d] QueryInterface failed, hr=%x\n", i, frame_index, hr); - if (hr != S_OK) goto end; - hr = IWICDdsDecoder_GetParameters(dds_decoder, ¶ms); - ok (hr == S_OK, "%d: GetParameters failed, hr=%x\n", i, hr); - if (hr != S_OK) goto end; - /* frame size tests */ hr = IWICBitmapFrameDecode_GetSize(frame_decode, NULL, NULL); @@ -418,12 +410,12 @@ static void test_dds_decoder_frame_properties(IWICBitmapDecoder *decoder, IWICBi ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICBitmapFrameDecode_GetSize(frame_decode, &width, &height); ok (hr == S_OK, "%d: GetSize failed for frame %d, hr=%x\n", i, frame_index, hr); - if (hr != S_OK) goto end; + if (hr != S_OK) return; - depth = params.Depth; - expected_width = params.Width; - expected_height = params.Height; - slice_index = frame_index % (frame_count / params.ArraySize); + depth = params->Depth; + expected_width = params->Width; + expected_height = params->Height; + slice_index = frame_index % (frame_count / params->ArraySize); while (slice_index >= depth) { if (expected_width > 1) expected_width /= 2; @@ -440,7 +432,7 @@ static void test_dds_decoder_frame_properties(IWICBitmapDecoder *decoder, IWICBi ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_GetFormatInfo(dds_frame, &format_info); ok (hr == S_OK, "%d: [frame %d] GetFormatInfo failed, hr=%x\n", i, frame_index, hr); - if (hr != S_OK) goto end; + if (hr != S_OK) return; ok (format_info.DxgiFormat == test_data[i].expected_parameters.DxgiFormat, "%d: [frame %d] Expected DXGI format 0x%x, got 0x%x\n", @@ -463,7 +455,7 @@ static void test_dds_decoder_frame_properties(IWICBitmapDecoder *decoder, IWICBi ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, &width_in_blocks, &height_in_blocks); ok (hr == S_OK, "%d: [frame %d] GetSizeInBlocks failed, hr=%x\n", i, frame_index, hr); - if (hr != S_OK) goto end; + if (hr != S_OK) return; expected_width_in_blocks = (expected_width + format_info.BlockWidth - 1) / format_info.BlockWidth; expected_height_in_blocks = (expected_height + format_info.BlockHeight - 1) / format_info.BlockHeight; @@ -472,33 +464,103 @@ static void test_dds_decoder_frame_properties(IWICBitmapDecoder *decoder, IWICBi ok (height_in_blocks == expected_height_in_blocks, "%d: [frame %d] Expected height in blocks %d, got %d\n", i, frame_index, expected_height_in_blocks, height_in_blocks); -end: - if (dds_decoder) IWICDdsDecoder_Release(dds_decoder); - if (dds_frame) IWICDdsFrameDecode_Release(dds_frame); +} + +static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT frame_count, WICDdsParameters *params, + int i, int frame_index) +{ + HRESULT hr; + WICDdsFormatInfo format_info; + WICRect rect = { 0, 0, 1, 1 }; + BYTE buffer[32]; + UINT stride, width_in_blocks, height_in_blocks; + UINT width, height, depth, array_index; + UINT block_offset; + int slice_index; + + hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, &width_in_blocks, &height_in_blocks); + ok (hr == S_OK, "%d: [frame %d] GetSizeInBlocks failed, hr=%x\n", i, frame_index, hr); + if (hr != S_OK) return; + hr = IWICDdsFrameDecode_GetFormatInfo(dds_frame, &format_info); + ok (hr == S_OK, "%d: [frame %d] GetFormatInfo failed, hr=%x\n", i, frame_index, hr); + if (hr != S_OK) return; + stride = width_in_blocks * format_info.BytesPerBlock; + + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, 0, 0, NULL); + todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, 0, 0, buffer); + todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, 0, 32, buffer); + todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, stride, 32, buffer); + todo_wine ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, 32, buffer); + todo_wine ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); + if (hr != S_OK) return; + + block_offset = 128; /* DDS magic and header */ + if (has_extended_header(test_data[i].data)) block_offset += 20; /* DDS extended header */ + width = params->Width; + height = params->Height; + depth = params->Depth; + slice_index = frame_index % (frame_count / params->ArraySize); + array_index = frame_index / (frame_count / params->ArraySize); + block_offset += (test_data[i].size - block_offset) / params->ArraySize * array_index; + while (slice_index >= 0) + { + width_in_blocks = (width + format_info.BlockWidth - 1) / format_info.BlockWidth; + height_in_blocks = (width + format_info.BlockWidth - 1) / format_info.BlockWidth; + block_offset += (slice_index >= depth) ? + (width_in_blocks * height_in_blocks * format_info.BytesPerBlock * depth) : + (width_in_blocks * height_in_blocks * format_info.BytesPerBlock * slice_index); + if (width > 1) width /= 2; + if (height > 1) height /= 2; + slice_index -= depth; + if (depth > 1) depth /= 2; + } + ok (!strncmp((const char *)test_data[i].data + block_offset, (const char *)buffer, format_info.BytesPerBlock), + "%d: [frame %d] Block data mismatch\n", i, frame_index); } static void test_dds_decoder_frame(IWICBitmapDecoder *decoder, int i) { HRESULT hr; + IWICDdsDecoder *dds_decoder = NULL; UINT frame_count, j; + WICDdsParameters params; hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count); ok (hr == S_OK, "%d: GetFrameCount failed, hr=%x\n", i, hr); if (hr != S_OK) return; + hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder); + ok(hr == S_OK, "%d: QueryInterface failed, hr=%x\n", i, hr); + if (hr != S_OK) goto end; + hr = IWICDdsDecoder_GetParameters(dds_decoder, ¶ms); + ok (hr == S_OK, "%d: GetParameters failed, hr=%x\n", i, hr); + if (hr != S_OK) goto end; for (j = 0; j < frame_count; j++) { IWICBitmapFrameDecode *frame_decode = NULL; + IWICDdsFrameDecode *dds_frame = NULL; hr = IWICBitmapDecoder_GetFrame(decoder, j, &frame_decode); ok (hr == S_OK, "%d: GetFrame failed for frame %d, hr=%x\n", i, j, hr); - if (hr != S_OK) { - IWICBitmapFrameDecode_Release(frame_decode); - continue; - } + if (hr != S_OK) goto next; + hr = IWICBitmapFrameDecode_QueryInterface(frame_decode, &IID_IWICDdsFrameDecode, (void **)&dds_frame); + ok(hr == S_OK, "%d: [frame %d] QueryInterface failed, hr=%x\n", i, j, hr); + if (hr != S_OK) goto next; + + test_dds_decoder_frame_properties(frame_decode, dds_frame, frame_count, ¶ms, i, j); + test_dds_decoder_frame_data(dds_frame, frame_count, ¶ms, i, j); - test_dds_decoder_frame_properties(decoder, frame_decode, frame_count, i, j); + next: + if (frame_decode) IWICBitmapFrameDecode_Release(frame_decode); + if (dds_frame) IWICDdsFrameDecode_Release(dds_frame); } + +end: + if (dds_decoder) IWICDdsDecoder_Release(dds_decoder); } static void test_dds_decoder(void)
1
0
0
0
Jacek Caban : configure: Enable -Wabsolute-value on cross compiler.
by Alexandre Julliard
03 Jun '20
03 Jun '20
Module: wine Branch: master Commit: 5de95badd210181ae61d15dd21b25ccfd77b06d0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5de95badd210181ae61d15dd…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed May 27 23:56:10 2020 +0200 configure: Enable -Wabsolute-value on cross compiler. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 31 +++++++++++++++++++++++++++++++ configure.ac | 1 + 2 files changed, 32 insertions(+) diff --git a/configure b/configure index ac0bdc7d79..bb98f99f9f 100755 --- a/configure +++ b/configure @@ -10417,6 +10417,37 @@ $as_echo "$ac_cv_crosscflags__Wlogical_op" >&6; } if test "x$ac_cv_crosscflags__Wlogical_op" = xyes; then : EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wlogical-op" fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -Wabsolute-value" >&5 +$as_echo_n "checking whether the cross-compiler supports -Wabsolute-value... " >&6; } +if ${ac_cv_crosscflags__Wabsolute_value+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +ac_wine_try_cflags_saved_cc=$CC +ac_wine_try_cflags_saved_exeext=$ac_exeext +CFLAGS="$CFLAGS $EXTRACROSSCFLAGS -nostartfiles -nodefaultlibs -Wabsolute-value" +CC="$CROSSCC" +ac_exeext=".exe" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int __cdecl mainCRTStartup(void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_crosscflags__Wabsolute_value=yes +else + ac_cv_crosscflags__Wabsolute_value=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +CC=$ac_wine_try_cflags_saved_cc +ac_exeext=$ac_wine_try_cflags_saved_exeext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_crosscflags__Wabsolute_value" >&5 +$as_echo "$ac_cv_crosscflags__Wabsolute_value" >&6; } +if test "x$ac_cv_crosscflags__Wabsolute_value" = xyes; then : + EXTRACROSSCFLAGS="$EXTRACROSSCFLAGS -Wabsolute-value" +fi case $host_cpu in *i[3456789]86*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -fno-omit-frame-pointer" >&5 diff --git a/configure.ac b/configure.ac index 33a8a9a288..e3d63ed750 100644 --- a/configure.ac +++ b/configure.ac @@ -1090,6 +1090,7 @@ then WINE_TRY_CROSSCFLAGS([-Wwrite-strings]) WINE_TRY_CROSSCFLAGS([-Wpointer-arith]) WINE_TRY_CROSSCFLAGS([-Wlogical-op]) + WINE_TRY_CROSSCFLAGS([-Wabsolute-value]) case $host_cpu in *i[[3456789]]86*) WINE_TRY_CROSSCFLAGS([-fno-omit-frame-pointer]) ;;
1
0
0
0
← Newer
1
...
71
72
73
74
75
76
77
...
95
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
Results per page:
10
25
50
100
200