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
February 2021
----- 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
2 participants
915 discussions
Start a n
N
ew thread
Henri Verbeet : vkd3d-shader: Rename VKD3D_SHADER_INSTRUCTION_HANDLER to vkd3d_shader_opcode.
by Alexandre Julliard
16 Feb '21
16 Feb '21
Module: vkd3d Branch: master Commit: 8315d319f67a42785b3dfec8f7987fdf8e7ce95a URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=8315d319f67a42785b3dfec…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Feb 16 14:58:23 2021 +0100 vkd3d-shader: Rename VKD3D_SHADER_INSTRUCTION_HANDLER to vkd3d_shader_opcode. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/dxbc.c | 2 +- libs/vkd3d-shader/spirv.c | 14 +++++++------- libs/vkd3d-shader/vkd3d_shader_main.c | 4 ++-- libs/vkd3d-shader/vkd3d_shader_private.h | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 278912d..5b56259 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -481,7 +481,7 @@ struct vkd3d_sm4_data struct vkd3d_sm4_opcode_info { enum vkd3d_sm4_opcode opcode; - enum VKD3D_SHADER_INSTRUCTION_HANDLER handler_idx; + enum vkd3d_shader_opcode handler_idx; const char *dst_info; const char *src_info; void (*read_opcode_func)(struct vkd3d_shader_instruction *ins, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 148115a..b0b2399 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2131,7 +2131,7 @@ struct vkd3d_push_constant_buffer_binding struct vkd3d_shader_phase { - enum VKD3D_SHADER_INSTRUCTION_HANDLER type; + enum vkd3d_shader_opcode type; unsigned int idx; unsigned int instance_count; uint32_t function_id; @@ -6417,7 +6417,7 @@ static SpvOp vkd3d_dxbc_compiler_map_alu_instruction(const struct vkd3d_shader_i { static const struct { - enum VKD3D_SHADER_INSTRUCTION_HANDLER handler_idx; + enum vkd3d_shader_opcode handler_idx; SpvOp spirv_op; } alu_ops[] = @@ -6491,7 +6491,7 @@ static enum GLSLstd450 vkd3d_dxbc_compiler_map_ext_glsl_instruction( { static const struct { - enum VKD3D_SHADER_INSTRUCTION_HANDLER handler_idx; + enum vkd3d_shader_opcode handler_idx; enum GLSLstd450 glsl_inst; } glsl_insts[] = @@ -7514,7 +7514,7 @@ static void vkd3d_dxbc_compiler_emit_deriv_instruction(struct vkd3d_dxbc_compile static const struct instruction_info { - enum VKD3D_SHADER_INSTRUCTION_HANDLER handler_idx; + enum vkd3d_shader_opcode handler_idx; SpvOp op; bool needs_derivative_control; } @@ -8402,7 +8402,7 @@ static SpvOp vkd3d_dxbc_compiler_map_atomic_instruction(const struct vkd3d_shade { static const struct { - enum VKD3D_SHADER_INSTRUCTION_HANDLER handler_idx; + enum vkd3d_shader_opcode handler_idx; SpvOp spirv_op; } atomic_ops[] = @@ -8438,7 +8438,7 @@ static SpvOp vkd3d_dxbc_compiler_map_atomic_instruction(const struct vkd3d_shade return SpvOpMax; } -static bool is_imm_atomic_instruction(enum VKD3D_SHADER_INSTRUCTION_HANDLER handler_idx) +static bool is_imm_atomic_instruction(enum vkd3d_shader_opcode handler_idx) { return VKD3DSIH_IMM_ATOMIC_ALLOC <= handler_idx && handler_idx <= VKD3DSIH_IMM_ATOMIC_XOR; } @@ -9029,7 +9029,7 @@ static void vkd3d_dxbc_compiler_emit_main_prolog(struct vkd3d_dxbc_compiler *com vkd3d_dxbc_compiler_emit_hull_shader_inputs(compiler); } -static bool is_dcl_instruction(enum VKD3D_SHADER_INSTRUCTION_HANDLER handler_idx) +static bool is_dcl_instruction(enum vkd3d_shader_opcode handler_idx) { return (VKD3DSIH_DCL <= handler_idx && handler_idx <= VKD3DSIH_DCL_VERTICES_OUT) || handler_idx == VKD3DSIH_HS_DECLS; diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index ff917db..c1306ca 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -460,7 +460,7 @@ static struct vkd3d_shader_descriptor_info *vkd3d_shader_scan_get_uav_descriptor static bool vkd3d_shader_instruction_is_uav_read(const struct vkd3d_shader_instruction *instruction) { - enum VKD3D_SHADER_INSTRUCTION_HANDLER handler_idx = instruction->handler_idx; + enum vkd3d_shader_opcode handler_idx = instruction->handler_idx; return (VKD3DSIH_ATOMIC_AND <= handler_idx && handler_idx <= VKD3DSIH_ATOMIC_XOR) || (VKD3DSIH_IMM_ATOMIC_ALLOC <= handler_idx && handler_idx <= VKD3DSIH_IMM_ATOMIC_XOR) || handler_idx == VKD3DSIH_LD_UAV_TYPED @@ -482,7 +482,7 @@ static void vkd3d_shader_scan_record_uav_read(struct vkd3d_shader_scan_context * static bool vkd3d_shader_instruction_is_uav_counter(const struct vkd3d_shader_instruction *instruction) { - enum VKD3D_SHADER_INSTRUCTION_HANDLER handler_idx = instruction->handler_idx; + enum vkd3d_shader_opcode handler_idx = instruction->handler_idx; return handler_idx == VKD3DSIH_IMM_ATOMIC_ALLOC || handler_idx == VKD3DSIH_IMM_ATOMIC_CONSUME; } diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 01ad087..1975848 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -93,7 +93,7 @@ enum vkd3d_shader_error VKD3D_SHADER_WARNING_PP_DIV_BY_ZERO = 4306, }; -enum VKD3D_SHADER_INSTRUCTION_HANDLER +enum vkd3d_shader_opcode { VKD3DSIH_ABS, VKD3DSIH_ADD, @@ -779,7 +779,7 @@ struct vkd3d_shader_primitive_type struct vkd3d_shader_instruction { - enum VKD3D_SHADER_INSTRUCTION_HANDLER handler_idx; + enum vkd3d_shader_opcode handler_idx; DWORD flags; unsigned int dst_count; unsigned int src_count;
1
0
0
0
Zebediah Figura : vkd3d-shader: Avoid using debugging utilities in debug_hlsl_type().
by Alexandre Julliard
16 Feb '21
16 Feb '21
Module: vkd3d Branch: master Commit: b57ad006c25f024144db9d6010befb0f95eefecf URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=b57ad006c25f024144db9d6…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Feb 12 14:38:50 2021 -0600 vkd3d-shader: Avoid using debugging utilities in debug_hlsl_type(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.c | 65 ++++++++++++++++++++++++++++++------------------ libs/vkd3d-shader/hlsl.h | 4 ++- libs/vkd3d-shader/hlsl.y | 16 +++++++++--- 3 files changed, 56 insertions(+), 29 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 4bdcd18..f181439 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -667,31 +667,55 @@ const char *hlsl_base_type_to_string(const struct hlsl_type *type) return name; } -const char *debug_hlsl_type(const struct hlsl_type *type) +char *hlsl_type_to_string(const struct hlsl_type *type) { const char *name; + char *string; if (type->name) - return debugstr_a(type->name); - - if (type->type == HLSL_CLASS_STRUCT) - return "<anonymous struct>"; + return vkd3d_strdup(type->name); - if (type->type == HLSL_CLASS_ARRAY) + switch (type->type) { - return vkd3d_dbg_sprintf("%s[%u]", hlsl_base_type_to_string(type->e.array.type), - type->e.array.elements_count); + case HLSL_CLASS_SCALAR: + return vkd3d_strdup(hlsl_base_type_to_string(type)); + + case HLSL_CLASS_VECTOR: + name = hlsl_base_type_to_string(type); + if ((string = malloc(strlen(name) + 2))) + sprintf(string, "%s%u", name, type->dimx); + return string; + + case HLSL_CLASS_MATRIX: + name = hlsl_base_type_to_string(type); + if ((string = malloc(strlen(name) + 4))) + sprintf(string, "%s%ux%u", name, type->dimx, type->dimy); + return string; + + case HLSL_CLASS_ARRAY: + name = hlsl_base_type_to_string(type->e.array.type); + if ((string = malloc(strlen(name) + 15))) + sprintf(string, "%s[%u]", name, type->e.array.elements_count); + return string; + + case HLSL_CLASS_STRUCT: + return vkd3d_strdup("<anonymous struct>"); + + default: + return vkd3d_strdup("<unexpected type>"); } +} - name = hlsl_base_type_to_string(type); +const char *debug_hlsl_type(const struct hlsl_type *type) +{ + const char *ret; + char *string; - if (type->type == HLSL_CLASS_SCALAR) - return vkd3d_dbg_sprintf("%s", name); - if (type->type == HLSL_CLASS_VECTOR) - return vkd3d_dbg_sprintf("%s%u", name, type->dimx); - if (type->type == HLSL_CLASS_MATRIX) - return vkd3d_dbg_sprintf("%s%ux%u", name, type->dimx, type->dimy); - return "unexpected_type"; + if (!(string = hlsl_type_to_string(type))) + return NULL; + ret = vkd3d_dbg_sprintf("%s", string); + vkd3d_free(string); + return ret; } char *hlsl_modifiers_to_string(unsigned int modifiers) @@ -795,11 +819,7 @@ static void dump_ir_var(struct vkd3d_string_buffer *buffer, const struct hlsl_ir static void dump_deref(struct vkd3d_string_buffer *buffer, const struct hlsl_deref *deref) { - if (deref->offset.node) - /* Print the variable's type for convenience. */ - vkd3d_string_buffer_printf(buffer, "(%s %s)", debug_hlsl_type(deref->var->data_type), deref->var->name); - else - vkd3d_string_buffer_printf(buffer, "%s", deref->var->name); + vkd3d_string_buffer_printf(buffer, "%s", deref->var->name); if (deref->offset.node) { vkd3d_string_buffer_printf(buffer, "["); @@ -948,9 +968,6 @@ static const char *debug_expr_op(const struct hlsl_ir_expr *expr) ",", }; - if (expr->op == HLSL_IR_UNOP_CAST) - return debug_hlsl_type(expr->node.data_type); - return op_names[expr->op]; } diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 2ca432a..b2b7daf 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -494,8 +494,10 @@ static inline void hlsl_src_remove(struct hlsl_src *src) src->node = NULL; } -const char *hlsl_base_type_to_string(const struct hlsl_type *type) DECLSPEC_HIDDEN; const char *debug_hlsl_type(const struct hlsl_type *type) DECLSPEC_HIDDEN; + +const char *hlsl_base_type_to_string(const struct hlsl_type *type) DECLSPEC_HIDDEN; +char *hlsl_type_to_string(const struct hlsl_type *type) DECLSPEC_HIDDEN; char *hlsl_modifiers_to_string(unsigned int modifiers) DECLSPEC_HIDDEN; const char *hlsl_node_type_to_string(enum hlsl_ir_node_type type) DECLSPEC_HIDDEN; diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 32a37e2..8b91ff5 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -254,8 +254,12 @@ static struct hlsl_ir_node *add_implicit_conversion(struct hlsl_ctx *ctx, struct if (!implicit_compatible_data_types(src_type, dst_type)) { - hlsl_error(ctx, *loc, "can't implicitly convert %s to %s", - debug_hlsl_type(src_type), debug_hlsl_type(dst_type)); + char *src_string = hlsl_type_to_string(src_type), *dst_string = hlsl_type_to_string(dst_type); + + if (src_string && dst_string) + hlsl_error(ctx, *loc, "Can't implicitly convert from %s to %s.", src_string, dst_string); + vkd3d_free(src_string); + vkd3d_free(dst_string); return NULL; } @@ -2728,8 +2732,12 @@ unary_expr: if (!compatible_data_types(src_type, dst_type)) { - hlsl_error(ctx, @3, "can't cast from %s to %s", - debug_hlsl_type(src_type), debug_hlsl_type(dst_type)); + char *src_string = hlsl_type_to_string(src_type), *dst_string = hlsl_type_to_string(dst_type); + + if (src_string && dst_string) + hlsl_error(ctx, @3, "Can't cast from %s to %s.", src_string, dst_string); + vkd3d_free(src_string); + vkd3d_free(dst_string); YYABORT; }
1
0
0
0
Zebediah Figura : vkd3d-shader: Avoid using debugging utilities in hlsl_debug_modifiers().
by Alexandre Julliard
16 Feb '21
16 Feb '21
Module: vkd3d Branch: master Commit: 61c3d802ed3eed475153ea1cc4b4de443fd71c43 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=61c3d802ed3eed475153ea1…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Feb 12 14:38:49 2021 -0600 vkd3d-shader: Avoid using debugging utilities in hlsl_debug_modifiers(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.c | 49 ++++++++++++++++++++++++++++++------------------ libs/vkd3d-shader/hlsl.h | 2 +- libs/vkd3d-shader/hlsl.y | 14 ++++++++++++-- 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index c4e0614..4bdcd18 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -694,41 +694,48 @@ const char *debug_hlsl_type(const struct hlsl_type *type) return "unexpected_type"; } -const char *hlsl_debug_modifiers(DWORD modifiers) +char *hlsl_modifiers_to_string(unsigned int modifiers) { - char string[110]; + char *string; + size_t len; + + if (!(string = vkd3d_malloc(110))) + return NULL; string[0] = 0; if (modifiers & HLSL_STORAGE_EXTERN) - strcat(string, " extern"); /* 7 */ + strcat(string, "extern "); /* 7 */ if (modifiers & HLSL_STORAGE_NOINTERPOLATION) - strcat(string, " nointerpolation"); /* 16 */ + strcat(string, "nointerpolation "); /* 16 */ if (modifiers & HLSL_MODIFIER_PRECISE) - strcat(string, " precise"); /* 8 */ + strcat(string, "precise "); /* 8 */ if (modifiers & HLSL_STORAGE_SHARED) - strcat(string, " shared"); /* 7 */ + strcat(string, "shared "); /* 7 */ if (modifiers & HLSL_STORAGE_GROUPSHARED) - strcat(string, " groupshared"); /* 12 */ + strcat(string, "groupshared "); /* 12 */ if (modifiers & HLSL_STORAGE_STATIC) - strcat(string, " static"); /* 7 */ + strcat(string, "static "); /* 7 */ if (modifiers & HLSL_STORAGE_UNIFORM) - strcat(string, " uniform"); /* 8 */ + strcat(string, "uniform "); /* 8 */ if (modifiers & HLSL_STORAGE_VOLATILE) - strcat(string, " volatile"); /* 9 */ + strcat(string, "volatile "); /* 9 */ if (modifiers & HLSL_MODIFIER_CONST) - strcat(string, " const"); /* 6 */ + strcat(string, "const "); /* 6 */ if (modifiers & HLSL_MODIFIER_ROW_MAJOR) - strcat(string, " row_major"); /* 10 */ + strcat(string, "row_major "); /* 10 */ if (modifiers & HLSL_MODIFIER_COLUMN_MAJOR) - strcat(string, " column_major"); /* 13 */ + strcat(string, "column_major "); /* 13 */ if ((modifiers & (HLSL_STORAGE_IN | HLSL_STORAGE_OUT)) == (HLSL_STORAGE_IN | HLSL_STORAGE_OUT)) - strcat(string, " inout"); /* 6 */ + strcat(string, "inout "); /* 6 */ else if (modifiers & HLSL_STORAGE_IN) - strcat(string, " in"); /* 3 */ + strcat(string, "in "); /* 3 */ else if (modifiers & HLSL_STORAGE_OUT) - strcat(string, " out"); /* 4 */ + strcat(string, "out "); /* 4 */ + + if ((len = strlen(string))) + string[len - 1] = 0; - return vkd3d_dbg_sprintf("%s", string[0] ? string + 1 : ""); + return string; } const char *hlsl_node_type_to_string(enum hlsl_ir_node_type type) @@ -774,7 +781,13 @@ static void dump_src(struct vkd3d_string_buffer *buffer, const struct hlsl_src * static void dump_ir_var(struct vkd3d_string_buffer *buffer, const struct hlsl_ir_var *var) { if (var->modifiers) - vkd3d_string_buffer_printf(buffer, "%s ", hlsl_debug_modifiers(var->modifiers)); + { + char *string; + + if ((string = hlsl_modifiers_to_string(var->modifiers))) + vkd3d_string_buffer_printf(buffer, "%s ", string); + vkd3d_free(string); + } vkd3d_string_buffer_printf(buffer, "%s %s", debug_hlsl_type(var->data_type), var->name); if (var->semantic) vkd3d_string_buffer_printf(buffer, " : %s", var->semantic); diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 88e7df5..2ca432a 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -496,7 +496,7 @@ static inline void hlsl_src_remove(struct hlsl_src *src) const char *hlsl_base_type_to_string(const struct hlsl_type *type) DECLSPEC_HIDDEN; const char *debug_hlsl_type(const struct hlsl_type *type) DECLSPEC_HIDDEN; -const char *hlsl_debug_modifiers(DWORD modifiers) DECLSPEC_HIDDEN; +char *hlsl_modifiers_to_string(unsigned int modifiers) DECLSPEC_HIDDEN; const char *hlsl_node_type_to_string(enum hlsl_ir_node_type type) DECLSPEC_HIDDEN; void hlsl_add_function(struct rb_tree *funcs, char *name, struct hlsl_ir_function_decl *decl, diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 6e0669b..32a37e2 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -282,8 +282,14 @@ static bool declare_variable(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, boo if (invalid) { - hlsl_error(ctx, decl->loc, "modifier '%s' invalid for local variables", hlsl_debug_modifiers(invalid)); + char *string; + + if ((string = hlsl_modifiers_to_string(invalid))) + hlsl_error(ctx, decl->loc, + "Modifiers '%s' are not allowed on local variables.", string); + vkd3d_free(string); } + if (decl->semantic) { hlsl_error(ctx, decl->loc, "semantics are not allowed on local variables"); @@ -314,7 +320,11 @@ static DWORD add_modifiers(struct hlsl_ctx *ctx, DWORD modifiers, DWORD mod, con { if (modifiers & mod) { - hlsl_error(ctx, loc, "modifier '%s' already specified", hlsl_debug_modifiers(mod)); + char *string; + + if ((string = hlsl_modifiers_to_string(mod))) + hlsl_error(ctx, loc, "Modifier '%s' was already specified.", string); + vkd3d_free(string); return modifiers; } if ((mod & HLSL_MODIFIERS_MAJORITY_MASK) && (modifiers & HLSL_MODIFIERS_MAJORITY_MASK))
1
0
0
0
Zebediah Figura : vkd3d-shader: Remove some TRACE messages.
by Alexandre Julliard
16 Feb '21
16 Feb '21
Module: vkd3d Branch: master Commit: 9b1b9e222a13b127f279a9d93e3a818a8999f942 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=9b1b9e222a13b127f279a9d…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Feb 12 14:38:48 2021 -0600 vkd3d-shader: Remove some TRACE messages. This patch can be freely ignored. I have not found any of these messages to be useful when debugging, but others may. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.c | 1 - libs/vkd3d-shader/hlsl.l | 2 -- libs/vkd3d-shader/hlsl.y | 38 -------------------------------------- 3 files changed, 41 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 4151c84..c4e0614 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -1255,7 +1255,6 @@ void hlsl_add_function(struct rb_tree *funcs, char *name, struct hlsl_ir_functio ERR("Redeclaring a user defined function as an intrinsic.\n"); return; } - TRACE("Function %s redeclared as a user defined function.\n", debugstr_a(name)); func->intrinsic = intrinsic; rb_destroy(&func->overloads, free_function_decl_rb, NULL); rb_init(&func->overloads, compare_function_decl_rb); diff --git a/libs/vkd3d-shader/hlsl.l b/libs/vkd3d-shader/hlsl.l index a0e0bed..933c9b8 100644 --- a/libs/vkd3d-shader/hlsl.l +++ b/libs/vkd3d-shader/hlsl.l @@ -218,7 +218,6 @@ row_major {return KW_ROW_MAJOR; } } <pp>pragma{WS}+ { - TRACE("Got a #pragma.\n"); BEGIN(pp_pragma); } <pp_pragma>pack_matrix{WS}*\({WS}*row_major{WS}*\) { @@ -243,7 +242,6 @@ row_major {return KW_ROW_MAJOR; } } <pp_pragma>{ANY} {} <pp>[0-9]+ { - TRACE("Preprocessor line info.\n"); BEGIN(pp_line); yylval->intval = (atoi(yytext)); return PRE_LINE; diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 1bda8df..6e0669b 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -121,14 +121,6 @@ static struct hlsl_ir_node *node_from_list(struct list *list) return LIST_ENTRY(list_tail(list), struct hlsl_ir_node, entry); } -static void debug_dump_decl(struct hlsl_type *type, DWORD modifiers, const char *declname, unsigned int line_no) -{ - TRACE("Line %u: ", line_no); - if (modifiers) - TRACE("%s ", hlsl_debug_modifiers(modifiers)); - TRACE("%s %s;\n", debug_hlsl_type(type), declname); -} - static void check_invalid_matrix_modifiers(struct hlsl_ctx *ctx, DWORD modifiers, struct vkd3d_shader_location loc) { if (modifiers & HLSL_MODIFIERS_MAJORITY_MASK) @@ -270,8 +262,6 @@ static struct hlsl_ir_node *add_implicit_conversion(struct hlsl_ctx *ctx, struct if (dst_type->dimx * dst_type->dimy < src_type->dimx * src_type->dimy) hlsl_warning(ctx, *loc, "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 = hlsl_new_cast(node, dst_type, loc))) return NULL; list_add_tail(instrs, &cast->node.entry); @@ -282,7 +272,6 @@ static bool declare_variable(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, boo { bool ret; - TRACE("Declaring variable %s.\n", decl->name); if (decl->data_type->type != HLSL_CLASS_MATRIX) check_invalid_matrix_modifiers(ctx, decl->modifiers, decl->loc); @@ -428,7 +417,6 @@ static unsigned int initializer_size(const struct parse_initializer *initializer { count += hlsl_type_component_count(initializer->args[i]->data_type); } - TRACE("Initializer size = %u.\n", count); return count; } @@ -581,8 +569,6 @@ static struct hlsl_ir_load *add_load(struct hlsl_ctx *ctx, struct list *instrs, if (!(var = hlsl_new_synthetic_var(ctx, name, var_node->data_type, var_node->loc))) return NULL; - TRACE("Synthesized variable %p for %s node.\n", var, hlsl_node_type_to_string(var_node->type)); - if (!(assign = hlsl_new_simple_assignment(var, var_node))) return NULL; @@ -618,8 +604,6 @@ static struct hlsl_ir_load *add_array_load(struct hlsl_ctx *ctx, struct list *in struct hlsl_ir_constant *c; struct hlsl_ir_node *mul; - TRACE("Array load from type %s.\n", debug_hlsl_type(expr_type)); - if (expr_type->type == HLSL_CLASS_ARRAY) { data_type = expr_type->e.array.type; @@ -721,7 +705,6 @@ static struct list *gen_struct_fields(struct hlsl_ctx *ctx, struct hlsl_type *ty list_init(list); LIST_FOR_EACH_ENTRY_SAFE(v, v_next, fields, struct parse_variable_def, entry) { - debug_dump_decl(type, 0, v->name, v->loc.line); if (!(field = vkd3d_calloc(1, sizeof(*field)))) { vkd3d_free(v); @@ -1121,7 +1104,6 @@ static struct hlsl_ir_expr *add_expr(struct hlsl_ctx *ctx, struct list *instrs, break; if (hlsl_type_compare(operands[i]->data_type, type)) continue; - TRACE("Implicitly converting %s into %s in an expression.\n", debug_hlsl_type(operands[i]->data_type), debug_hlsl_type(type)); 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) { @@ -1292,7 +1274,6 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in enum hlsl_ir_expr_op op = op_from_assignment(assign_op); struct hlsl_ir_node *expr; - TRACE("Adding an expression for the compound assignment.\n"); expr = hlsl_new_binary_expr(op, lhs, rhs); list_add_after(&rhs->entry, &expr->entry); rhs = expr; @@ -1391,7 +1372,6 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t free_parse_variable_def(v); continue; } - debug_dump_decl(type, modifiers, v->name, v->loc.line); if (ctx->cur_scope == ctx->globals) { @@ -1414,14 +1394,12 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t vkd3d_free(v); continue; } - TRACE("Declared variable %s.\n", var->name); if (v->initializer.args_count) { unsigned int size = initializer_size(&v->initializer); struct hlsl_ir_load *load; - TRACE("Variable with initializer.\n"); if (type->type <= HLSL_CLASS_LAST_NUMERIC && type->dimx * type->dimy != size && size != 1) { @@ -1739,29 +1717,22 @@ hlsl_prog: "void function with a semantic"); } - TRACE("Adding function '%s' to the function list.\n", $2.name); hlsl_add_function(&ctx->functions, $2.name, $2.decl, false); } | hlsl_prog declaration_statement { - TRACE("Declaration statement parsed.\n"); - if (!list_empty($2)) FIXME("Uniform initializer.\n"); hlsl_free_instr_list($2); } | hlsl_prog preproc_directive | hlsl_prog ';' - { - TRACE("Skipping stray semicolon.\n"); - } preproc_directive: PRE_LINE STRING { const char **new_array = NULL; - TRACE("Updating line information to file %s, line %u.\n", debugstr_a($2), $1); ctx->location.line = $1; if (strcmp($2, ctx->location.source_name)) new_array = vkd3d_realloc(ctx->source_files, @@ -1813,7 +1784,6 @@ named_struct_spec: { bool ret; - TRACE("Structure %s declaration.\n", debugstr_a($2)); $$ = hlsl_new_struct_type(ctx, $2, $4); if (hlsl_get_var(ctx->cur_scope, $2)) @@ -1833,7 +1803,6 @@ named_struct_spec: unnamed_struct_spec: KW_STRUCT '{' fields_list '}' { - TRACE("Anonymous structure declaration.\n"); $$ = hlsl_new_struct_type(ctx, NULL, $3); } @@ -1884,14 +1853,12 @@ field: func_declaration: func_prototype compound_statement { - TRACE("Function %s parsed.\n", $1.name); $$ = $1; $$.decl->body = $2; hlsl_pop_scope(ctx); } | func_prototype ';' { - TRACE("Function prototype for %s.\n", $1.name); $$ = $1; hlsl_pop_scope(ctx); } @@ -2246,7 +2213,6 @@ variable_def: } | any_identifier array colon_attribute '=' complex_initializer { - TRACE("Declaration with initializer.\n"); $$ = vkd3d_calloc(1, sizeof(*$$)); $$->loc = @1; $$->name = $1; @@ -2273,7 +2239,6 @@ array: "array size is not a positive integer constant\n"); YYABORT; } - TRACE("Array size %u.\n", size); if (size > 65536) { @@ -3131,10 +3096,7 @@ int hlsl_parser_compile(struct hlsl_ctx *ctx, const char *entrypoint) index_instructions(entry_func->body, 2); if (TRACE_ON()) - { - TRACE("IR dump.\n"); rb_for_each_entry(&ctx->functions, dump_function, NULL); - } compute_liveness(ctx, entry_func);
1
0
0
0
Zebediah Figura : vkd3d-shader: Do not warn if a "for" initializer is empty.
by Alexandre Julliard
16 Feb '21
16 Feb '21
Module: vkd3d Branch: master Commit: 82c659539ff211d424f29024c5ec588266505615 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=82c659539ff211d424f2902…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Feb 12 14:38:47 2021 -0600 vkd3d-shader: Do not warn if a "for" initializer is empty. It is perfectly valid. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.y | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 2fda89e..1bda8df 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2464,8 +2464,6 @@ loop_statement: } | KW_FOR '(' scope_start declaration expr_statement expr ')' statement { - if (!$4) - hlsl_warning(ctx, @4, "no expressions in for loop initializer"); $$ = create_loop(LOOP_FOR, $4, $5, $6, $8, @1); hlsl_pop_scope(ctx); }
1
0
0
0
Zebediah Figura : vkd3d-shader: Replace "parse_status" with a boolean variable.
by Alexandre Julliard
16 Feb '21
16 Feb '21
Module: vkd3d Branch: master Commit: 193218f54ed50e79760dd9ac49103debc5c97eb3 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=193218f54ed50e79760dd9a…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Feb 12 14:38:46 2021 -0600 vkd3d-shader: Replace "parse_status" with a boolean variable. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.c | 4 +--- libs/vkd3d-shader/hlsl.h | 17 +---------------- libs/vkd3d-shader/hlsl.y | 6 +++--- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index a129e84..4151c84 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -35,14 +35,12 @@ void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, co { /* FIXME */ - set_parse_status(&ctx->status, PARSE_ERR); + ctx->failed = true; } void hlsl_warning(struct hlsl_ctx *ctx, const struct vkd3d_shader_location loc, const char *fmt, ...) { /* FIXME */ - - set_parse_status(&ctx->status, PARSE_WARN); } bool hlsl_add_var(struct hlsl_ctx *ctx, struct hlsl_ir_var *decl, bool local_var) diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 067aae8..88e7df5 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -23,13 +23,6 @@ #include "vkd3d_shader_private.h" #include "rbtree.h" -enum parse_status -{ - PARSE_SUCCESS = 0, - PARSE_WARN = 1, - PARSE_ERR = 2 -}; - /* The general IR structure is inspired by Mesa GLSL hir, even though the code * ends up being quite different in practice. Anyway, here comes the relevant * licensing information. @@ -396,8 +389,8 @@ struct hlsl_ctx const char **source_files; unsigned int source_files_count; struct vkd3d_shader_location location; - enum parse_status status; struct vkd3d_shader_message_context *message_context; + bool failed; void *scanner; @@ -501,14 +494,6 @@ static inline void hlsl_src_remove(struct hlsl_src *src) src->node = NULL; } -static inline void set_parse_status(enum parse_status *current, enum parse_status update) -{ - if (update == PARSE_ERR) - *current = PARSE_ERR; - else if (update == PARSE_WARN && *current == PARSE_SUCCESS) - *current = PARSE_WARN; -} - const char *hlsl_base_type_to_string(const struct hlsl_type *type) DECLSPEC_HIDDEN; const char *debug_hlsl_type(const struct hlsl_type *type) DECLSPEC_HIDDEN; const char *hlsl_debug_modifiers(DWORD modifiers) DECLSPEC_HIDDEN; diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index d7201f5..2fda89e 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2006,7 +2006,7 @@ param_list: if (!add_func_parameter(ctx, $$, &$1, @1)) { ERR("Error adding function parameter %s.\n", $1.name); - set_parse_status(&ctx->status, PARSE_ERR); + ctx->failed = true; YYABORT; } } @@ -3111,7 +3111,7 @@ int hlsl_parser_compile(struct hlsl_ctx *ctx, const char *entrypoint) yyparse(ctx->scanner, ctx); - if (ctx->status == PARSE_ERR) + if (ctx->failed) return VKD3D_ERROR_INVALID_SHADER; if (!(entry_func = get_func_entry(ctx, entrypoint))) @@ -3140,7 +3140,7 @@ int hlsl_parser_compile(struct hlsl_ctx *ctx, const char *entrypoint) compute_liveness(ctx, entry_func); - if (ctx->status == PARSE_ERR) + if (ctx->failed) return VKD3D_ERROR_INVALID_SHADER; return VKD3D_ERROR_NOT_IMPLEMENTED; }
1
0
0
0
Francois Gouget : testbot/LogUtils: Rename the $ExtraGroup variable in ParseWineTestReport().
by Alexandre Julliard
16 Feb '21
16 Feb '21
Module: tools Branch: master Commit: 1480dcfb10b5e4324edb0a66352973035e0d7784 URL:
https://source.winehq.org/git/tools.git/?a=commit;h=1480dcfb10b5e4324edb0a6…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Tue Feb 16 15:55:11 2021 +0100 testbot/LogUtils: Rename the $ExtraGroup variable in ParseWineTestReport(). This makes it clearer that it has nothing to do with setting up the current group of errors. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/lib/WineTestBot/LogUtils.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm index 7a72958..2cb2ad2 100644 --- a/testbot/lib/WineTestBot/LogUtils.pm +++ b/testbot/lib/WineTestBot/LogUtils.pm @@ -738,10 +738,10 @@ sub ParseWineTestReport($$$) my $ExtraCount = @{$LogInfo->{Extra}}; if ($ExtraCount) { - my $CurGroup = _AddLogGroup($LogInfo, "Report validation errors"); - $CurGroup->{Errors} = $LogInfo->{Extra}; + my $ExtraGroup = _AddLogGroup($LogInfo, "Report validation errors"); + $ExtraGroup->{Errors} = $LogInfo->{Extra}; my @LineNos = (0) x $ExtraCount; - $CurGroup->{LineNos} = \@LineNos; + $ExtraGroup->{LineNos} = \@LineNos; $LogInfo->{ErrCount} += $ExtraCount; }
1
0
0
0
Francois Gouget : testbot/TestWTBS: There is no file for the "No patch found" disposition.
by Alexandre Julliard
16 Feb '21
16 Feb '21
Module: tools Branch: master Commit: 9e394a2ffaba165a53c5a7af10c9fbeff399f6f8 URL:
https://source.winehq.org/git/tools.git/?a=commit;h=9e394a2ffaba165a53c5a7a…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Tue Feb 16 15:54:57 2021 +0100 testbot/TestWTBS: There is no file for the "No patch found" disposition. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/tests/TestWTBS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testbot/tests/TestWTBS b/testbot/tests/TestWTBS index dbd1130..8a77b00 100755 --- a/testbot/tests/TestWTBS +++ b/testbot/tests/TestWTBS @@ -1382,7 +1382,9 @@ sub CheckPatches() } elsif ($Patch->Subject =~ /\bWTBS\b/) { - ok(($Patch->Subject =~ /NoPatch/ or $Patch->Disposition eq "Reply to a patch series"), + ok(($Patch->Subject =~ /NoPatch/ or + $Patch->Disposition eq "Reply to a patch series" or + $Patch->Disposition eq "No patch found"), "Found no file for patch ". $Patch->Id .": ". $Patch->Subject) or diag("Disposition=". $Patch->Disposition); }
1
0
0
0
Doug Kingston : winealsa: Add card number to duplicate device descriptions.
by Alexandre Julliard
15 Feb '21
15 Feb '21
Module: wine Branch: master Commit: a9c8196e97ec255f4f69d005ea1cbf8fcf2537e8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a9c8196e97ec255f4f69d005…
Author: Doug Kingston <dpk(a)google.com> Date: Mon Feb 15 10:26:13 2021 -0600 winealsa: Add card number to duplicate device descriptions. Devices with the same device description cannot be distinguished. Add card number to the description of second and subsequent instances of devices with the same description. This mimics Windows behavior. Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Doug Kingston <dpk(a)google.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winealsa.drv/mmdevdrv.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 318350471db..cf2edcc7454 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -22,6 +22,8 @@ #include "config.h" #include <stdarg.h> +#define _GNU_SOURCE +#include <stdio.h> #include <math.h> #include "windef.h" @@ -521,6 +523,36 @@ static void get_reg_devices(EDataFlow flow, snd_pcm_stream_t stream, WCHAR ***id } } +struct card_type { + struct list entry; + int first_card_number; + char string[1]; +}; + +static struct list card_types = LIST_INIT(card_types); + +static BOOL need_card_number(int card, const char *string) +{ + struct card_type *cptr; + + LIST_FOR_EACH_ENTRY(cptr, &card_types, struct card_type, entry) + { + if(!strcmp(string, cptr->string)) + return card != cptr->first_card_number; + } + + /* this is the first instance of string */ + cptr = HeapAlloc(GetProcessHeap(), 0, sizeof(struct card_type) + strlen(string)); + if(!cptr) + /* Default to displaying card number if we can't track cards */ + return TRUE; + + cptr->first_card_number = card; + strcpy(cptr->string, string); + list_add_head(&card_types, &cptr->entry); + return FALSE; +} + static HRESULT alsa_enum_devices(EDataFlow flow, WCHAR ***ids, GUID **guids, UINT *num) { @@ -564,6 +596,17 @@ static HRESULT alsa_enum_devices(EDataFlow flow, WCHAR ***ids, GUID **guids, cardpath, err, snd_strerror(err)); alsa_get_card_devices(flow, stream, ids, guids, num, ctl, card, nameW); }else{ + if(need_card_number(card, cardname)){ + char *cardnameN; + /* + * For identical card names, second and subsequent instances get + * card number prefix to distinguish them (like Windows). + */ + if(asprintf(&cardnameN, "%u-%s", card, cardname) > 0){ + free(cardname); + cardname = cardnameN; + } + } len = MultiByteToWideChar(CP_UNIXCP, 0, cardname, -1, NULL, 0); cardnameW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1
0
0
0
Paul Gofman : msvcrt: Ignore inherited FDs with invalid handles in msvcrt_init_io().
by Alexandre Julliard
15 Feb '21
15 Feb '21
Module: wine Branch: master Commit: 611742d31fb042d642d5ac30eebf0d73154a3481 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=611742d31fb042d642d5ac30…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Feb 15 17:52:16 2021 +0300 msvcrt: Ignore inherited FDs with invalid handles in msvcrt_init_io(). The process std handles should be preserved in this case. Fixes error on startup in "Re:ZERO -Starting Life in Another World- The Prophecy of the Throne" launcher. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/file.c | 2 +- dlls/msvcrt/tests/file.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 73e1a82476f..89d6e7d721f 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -586,7 +586,7 @@ void msvcrt_init_io(void) count = min(count, MSVCRT_MAX_FILES); for (i = 0; i < count; i++) { - if ((*wxflag_ptr & WX_OPEN) && *handle_ptr != INVALID_HANDLE_VALUE) + if ((*wxflag_ptr & WX_OPEN) && GetFileType(*handle_ptr) != FILE_TYPE_UNKNOWN) { fdinfo = get_ioinfo_alloc_fd(i); if(fdinfo != &MSVCRT___badioinfo) diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index 0cf8bad124f..fb242d81282 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -1454,13 +1454,27 @@ static void test_file_write_read( void ) free(tempf); } -static void test_file_inherit_child(const char* fd_s) +static void test_file_inherit_child(const char* fd_s, const char *handle_str) { + HANDLE handle_value; int fd = atoi(fd_s); + HANDLE *handle_ptr; + unsigned int count; char buffer[32]; + STARTUPINFOA si; int ret; - ret =write(fd, "Success", 8); + GetStartupInfoA(&si); + count = *(unsigned *)si.lpReserved2; + if (handle_str) + { + ok(count == 3, "Got unexpected count %u.\n", count); + sscanf(handle_str, "%p", &handle_value); + handle_ptr = (HANDLE *)(si.lpReserved2 + sizeof(unsigned) + count); + ok(handle_value == handle_ptr[1], "Got unexpected handle %p.\n", handle_ptr[1]); + } + + ret = write(fd, "Success", 8); ok( ret == 8, "Couldn't write in child process on %d (%s)\n", fd, strerror(errno)); lseek(fd, 0, SEEK_SET); ok(read(fd, buffer, sizeof (buffer)) == 8, "Couldn't read back the data\n"); @@ -1643,6 +1657,22 @@ static void test_file_inherit( const char* selfname ) test_stdout_handle( &startup, cmdline, handles[1], TRUE, "large size block" ); CloseHandle( handles[1] ); DeleteFileA("fdopen.tst"); + + /* test inherit block with invalid handle */ + handles[1] = INVALID_HANDLE_VALUE; + create_io_inherit_block( &startup, 3, handles ); + sprintf(cmdline, "%s file inherit 1 %p", selfname, handles[1]); + test_stdout_handle( &startup, cmdline, NULL, FALSE, "INVALID_HANDLE_VALUE stdout handle" ); + + handles[1] = NULL; + create_io_inherit_block( &startup, 3, handles ); + sprintf(cmdline, "%s file inherit 1 %p", selfname, handles[1]); + test_stdout_handle( &startup, cmdline, NULL, FALSE, "NULL stdout handle" ); + + handles[1] = (void *)0xdeadbeef; + create_io_inherit_block( &startup, 3, handles ); + sprintf(cmdline, "%s file inherit 1 %p", selfname, handles[1]); + test_stdout_handle( &startup, cmdline, NULL, FALSE, "invalid stdout handle" ); } static void test_invalid_stdin_child( void ) @@ -2714,7 +2744,7 @@ START_TEST(file) if (arg_c >= 3) { if (strcmp(arg_v[2], "inherit") == 0) - test_file_inherit_child(arg_v[3]); + test_file_inherit_child(arg_v[3], arg_c > 4 ? arg_v[4] : NULL); else if (strcmp(arg_v[2], "inherit_no") == 0) test_file_inherit_child_no(arg_v[3]); else if (strcmp(arg_v[2], "pipes") == 0)
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
92
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
Results per page:
10
25
50
100
200