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
June
May
April
March
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
January 2023
----- 2025 -----
June 2025
May 2025
April 2025
March 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
467 discussions
Start a n
N
ew thread
Alexandre Julliard : winecrt0: Check for RTLD_SELF support to enable ELF constructors.
by Alexandre Julliard
11 Jan '23
11 Jan '23
Module: wine Branch: master Commit: e25d83dc903412bf70a82ed419e8c9e470addff2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e25d83dc903412bf70a82ed419e8c9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jan 11 15:14:04 2023 +0100 winecrt0: Check for RTLD_SELF support to enable ELF constructors. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54218
--- dlls/winecrt0/dll_soinit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winecrt0/dll_soinit.c b/dlls/winecrt0/dll_soinit.c index f76c2993304..77f5db3d284 100644 --- a/dlls/winecrt0/dll_soinit.c +++ b/dlls/winecrt0/dll_soinit.c @@ -77,7 +77,7 @@ static BOOL get_relocbase(caddr_t mapbase, caddr_t *relocbase) */ void __wine_init_so_dll(void) { -#if defined(HAVE_DLADDR1) || defined(HAVE_DLINFO) +#if defined(HAVE_DLADDR1) || (defined(HAVE_DLINFO) && defined(RTLD_SELF)) struct link_map *map; void (*init_func)(int, char **, char **) = NULL; void (**init_array)(int, char **, char **) = NULL;
1
0
0
0
Eric Pouech : po: Update French translations.
by Alexandre Julliard
11 Jan '23
11 Jan '23
Module: wine Branch: master Commit: d5e8d3a15cfe225fb8f82a8b6f094272838837d2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d5e8d3a15cfe225fb8f82a8b6f0942…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Wed Jan 11 13:14:54 2023 +0100 po: Update French translations. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- po/fr.po | 248 +++++++++++++++------------------------------------------------ 1 file changed, 59 insertions(+), 189 deletions(-)
1
0
0
0
Eric Pouech : conhost: Initialize color_map when creating an alternate screen buffer.
by Alexandre Julliard
11 Jan '23
11 Jan '23
Module: wine Branch: master Commit: ec05c03463368ed0f5309def116c88a4376d8db6 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ec05c03463368ed0f5309def116c88…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Wed Jan 11 14:07:17 2023 +0100 conhost: Initialize color_map when creating an alternate screen buffer. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54287
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- programs/conhost/conhost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index bf46e6b1c18..800e8bab822 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -96,6 +96,7 @@ static struct screen_buffer *create_screen_buffer( struct console *console, int screen_buffer->attr = console->active->attr; screen_buffer->popup_attr = console->active->attr; screen_buffer->font = console->active->font; + memcpy( screen_buffer->color_map, console->active->color_map, sizeof(console->active->color_map) ); if (screen_buffer->font.face_len) {
1
0
0
0
Eric Pouech : conhost: Reset console attribute upon exit in unix mode.
by Alexandre Julliard
11 Jan '23
11 Jan '23
Module: wine Branch: master Commit: 8993f5720a453aecb9ead2cd7531f6513340de97 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8993f5720a453aecb9ead2cd7531f6…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Wed Jan 11 10:34:03 2023 +0100 conhost: Reset console attribute upon exit in unix mode. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- programs/conhost/conhost.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 769f998f404..bf46e6b1c18 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -2859,9 +2859,18 @@ static int main_loop( struct console *console, HANDLE signal ) return 0; } +static void teardown( struct console *console ) +{ + if (console->is_unix) + { + set_tty_attr( console, empty_char_info.attr ); + tty_flush( console ); + } +} + int __cdecl wmain(int argc, WCHAR *argv[]) { - int headless = 0, i, width = 0, height = 0; + int headless = 0, i, width = 0, height = 0, ret; HANDLE signal = NULL; WCHAR *end; @@ -2954,5 +2963,8 @@ int __cdecl wmain(int argc, WCHAR *argv[]) ShowWindow( console.win, (si.dwFlags & STARTF_USESHOWWINDOW) ? si.wShowWindow : SW_SHOW ); } - return main_loop( &console, signal ); + ret = main_loop( &console, signal ); + teardown( &console ); + + return ret; }
1
0
0
0
Hugh McMaster : conhost: Migrate from FontPitchFamily to FontFamily.
by Alexandre Julliard
11 Jan '23
11 Jan '23
Module: wine Branch: master Commit: 0e6b21ef1d775c34fa14d8f527468b1a65df3eda URL:
https://gitlab.winehq.org/wine/wine/-/commit/0e6b21ef1d775c34fa14d8f527468b…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Fri Dec 23 22:09:49 2022 +1100 conhost: Migrate from FontPitchFamily to FontFamily. To ensure a seamless transition between value names, we try loading the registry value from FontFamily first and FontPitchFamily second. Any changes to the console font family are saved to the new value name. --- programs/conhost/window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/programs/conhost/window.c b/programs/conhost/window.c index 3db4b159696..0a44186beb1 100644 --- a/programs/conhost/window.c +++ b/programs/conhost/window.c @@ -166,7 +166,8 @@ static void load_registry_key( HKEY key, struct console_config *config ) RegQueryValueExW( key, L"FaceName", 0, &type, (BYTE *)&config->face_name, &count ); count = sizeof(val); - if (!RegQueryValueExW( key, L"FontPitchFamily", 0, &type, (BYTE *)&val, &count )) + if (!RegQueryValueExW( key, L"FontFamily", 0, &type, (BYTE *)&val, &count ) || + !RegQueryValueExW( key, L"FontPitchFamily", 0, &type, (BYTE *)&val, &count )) config->font_pitch_family = val; count = sizeof(val); @@ -330,7 +331,7 @@ static void save_registry_key( HKEY key, const struct console_config *config, BO if (save_all || config->font_pitch_family != default_config.font_pitch_family) { val = config->font_pitch_family; - RegSetValueExW( key, L"FontPitchFamily", 0, REG_DWORD, (BYTE *)&val, sizeof(val) ); + RegSetValueExW( key, L"FontFamily", 0, REG_DWORD, (BYTE *)&val, sizeof(val) ); } if (save_all || config->cell_height != default_config.cell_height ||
1
0
0
0
Francisco Casas : vkd3d-shader/hlsl: Use add_unary_arithmetic_expr() in intrinsic_pow().
by Alexandre Julliard
11 Jan '23
11 Jan '23
Module: vkd3d Branch: master Commit: 5b1030e0cb216c9a3985561511736fc427b76be5 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/5b1030e0cb216c9a3985561511736…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Mon Nov 7 19:20:01 2022 -0300 vkd3d-shader/hlsl: Use add_unary_arithmetic_expr() in intrinsic_pow(). Using add_unary_arithmetic_expr() instead of hlsl_new_unary_expr() allows the intrinsic to work with matrices. Otherwise we get: E5017: Aborting due to not yet implemented feature: Copying from unsupported node type. because an HLSL_IR_EXPR reaches split_matrix_copies(). --- libs/vkd3d-shader/hlsl.y | 7 +++---- tests/pow.shader_test | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index cbc59bc5..f67b5118 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2661,16 +2661,15 @@ static bool intrinsic_pow(struct hlsl_ctx *ctx, if (!elementwise_intrinsic_float_convert_args(ctx, params, loc)) return false; - if (!(log = hlsl_new_unary_expr(ctx, HLSL_OP1_LOG2, params->args[0], *loc))) + if (!(log = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_LOG2, params->args[0], loc))) return false; - list_add_tail(params->instrs, &log->entry); if (!(mul = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, params->args[1], log, loc))) return false; - if (!(exp = hlsl_new_unary_expr(ctx, HLSL_OP1_EXP2, mul, *loc))) + if (!(exp = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_EXP2, mul, loc))) return false; - list_add_tail(params->instrs, &exp->entry); + return true; } diff --git a/tests/pow.shader_test b/tests/pow.shader_test index 0c1d7de3..1bb3bd94 100644 --- a/tests/pow.shader_test +++ b/tests/pow.shader_test @@ -10,7 +10,7 @@ draw quad probe all rgba (0.512, 0.101192884, 0.64, 0.25) 4 -[pixel shader todo] +[pixel shader] float4 main() : sv_target { float2x3 a = {1, 2, 3, 4, 5, 6}; @@ -21,8 +21,8 @@ float4 main() : sv_target } [test] -todo draw quad -todo probe all rgba (1.0, 32.0, 256.0, 125.0) +draw quad +probe all rgba (1.0, 32.0, 256.0, 125.0) 2 [pixel shader fail]
1
0
0
0
Francisco Casas : vkd3d-shader/hlsl: Introduce elementwise_intrinsic_float_convert_args().
by Alexandre Julliard
11 Jan '23
11 Jan '23
Module: vkd3d Branch: master Commit: 6770ecbdf42b602c1f593f66c880b093691564c8 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/6770ecbdf42b602c1f593f66c880b…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Tue Dec 13 20:13:56 2022 -0300 vkd3d-shader/hlsl: Introduce elementwise_intrinsic_float_convert_args(). --- libs/vkd3d-shader/hlsl.y | 56 ++++++++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index c0ec779f..cbc59bc5 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2303,6 +2303,19 @@ static bool elementwise_intrinsic_convert_args(struct hlsl_ctx *ctx, return convert_args(ctx, params, common_type, loc); } +static bool elementwise_intrinsic_float_convert_args(struct hlsl_ctx *ctx, + const struct parse_initializer *params, const struct vkd3d_shader_location *loc) +{ + struct hlsl_type *type; + + if (!(type = elementwise_intrinsic_get_common_type(ctx, params, loc))) + return false; + + type = hlsl_get_numeric_type(ctx, type->type, HLSL_TYPE_FLOAT, type->dimx, type->dimy); + + return convert_args(ctx, params, type, loc); +} + static bool intrinsic_abs(struct hlsl_ctx *ctx, const struct parse_initializer *params, const struct vkd3d_shader_location *loc) { @@ -2442,13 +2455,10 @@ static bool intrinsic_ldexp(struct hlsl_ctx *ctx, { struct hlsl_ir_node *arg; - if (!elementwise_intrinsic_convert_args(ctx, params, loc)) + if (!elementwise_intrinsic_float_convert_args(ctx, params, loc)) return false; - if (!(arg = intrinsic_float_convert_arg(ctx, params, params->args[1], loc))) - return false; - - if (!(arg = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_EXP2, arg, loc))) + if (!(arg = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_EXP2, params->args[1], loc))) return false; return !!add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, params->args[0], arg, loc); @@ -2482,15 +2492,12 @@ static bool intrinsic_length(struct hlsl_ctx *ctx, static bool intrinsic_lerp(struct hlsl_ctx *ctx, const struct parse_initializer *params, const struct vkd3d_shader_location *loc) { - struct hlsl_ir_node *arg, *neg, *add, *mul; - - if (!elementwise_intrinsic_convert_args(ctx, params, loc)) - return false; + struct hlsl_ir_node *neg, *add, *mul; - if (!(arg = intrinsic_float_convert_arg(ctx, params, params->args[0], loc))) + if (!elementwise_intrinsic_float_convert_args(ctx, params, loc)) return false; - if (!(neg = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_NEG, arg, loc))) + if (!(neg = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_NEG, params->args[0], loc))) return false; if (!(add = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_ADD, params->args[1], neg, loc))) @@ -2499,7 +2506,7 @@ static bool intrinsic_lerp(struct hlsl_ctx *ctx, if (!(mul = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, params->args[2], add, loc))) return false; - return !!add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_ADD, arg, mul, loc); + return !!add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_ADD, params->args[0], mul, loc); } static bool intrinsic_max(struct hlsl_ctx *ctx, @@ -2649,15 +2656,12 @@ static bool intrinsic_normalize(struct hlsl_ctx *ctx, static bool intrinsic_pow(struct hlsl_ctx *ctx, const struct parse_initializer *params, const struct vkd3d_shader_location *loc) { - struct hlsl_ir_node *log, *exp, *arg, *mul; - - if (!elementwise_intrinsic_convert_args(ctx, params, loc)) - return false; + struct hlsl_ir_node *log, *exp, *mul; - if (!(arg = intrinsic_float_convert_arg(ctx, params, params->args[0], loc))) + if (!elementwise_intrinsic_float_convert_args(ctx, params, loc)) return false; - if (!(log = hlsl_new_unary_expr(ctx, HLSL_OP1_LOG2, arg, *loc))) + if (!(log = hlsl_new_unary_expr(ctx, HLSL_OP1_LOG2, params->args[0], *loc))) return false; list_add_tail(params->instrs, &log->entry); @@ -2698,28 +2702,14 @@ static bool intrinsic_smoothstep(struct hlsl_ctx *ctx, { struct hlsl_ir_node *min_arg, *max_arg, *x_arg, *p, *p_num, *p_denom, *res; struct hlsl_ir_constant *one, *minus_two, *three; - struct hlsl_type *common_type; - if (!elementwise_intrinsic_convert_args(ctx, params, loc)) + if (!elementwise_intrinsic_float_convert_args(ctx, params, loc)) return false; min_arg = params->args[0]; max_arg = params->args[1]; x_arg = params->args[2]; - common_type = x_arg->data_type; - common_type = hlsl_get_numeric_type(ctx, common_type->type, HLSL_TYPE_FLOAT, common_type->dimx, - common_type->dimy); - - if (!(min_arg = add_implicit_conversion(ctx, params->instrs, min_arg, common_type, loc))) - return false; - - if (!(max_arg = add_implicit_conversion(ctx, params->instrs, max_arg, common_type, loc))) - return false; - - if (!(x_arg = add_implicit_conversion(ctx, params->instrs, x_arg, common_type, loc))) - return false; - if (!(min_arg = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_NEG, min_arg, loc))) return false;
1
0
0
0
Francisco Casas : vkd3d-shader/hlsl: Convert elementwise intrinsics args to the proper common type.
by Alexandre Julliard
11 Jan '23
11 Jan '23
Module: vkd3d Branch: master Commit: 9ceed76a9c7f4b7bba8822b33974276922a50104 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/9ceed76a9c7f4b7bba8822b339742…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Mon Nov 7 19:05:52 2022 -0300 vkd3d-shader/hlsl: Convert elementwise intrinsics args to the proper common type. --- libs/vkd3d-shader/hlsl.y | 111 ++++++++++++++++++++++++++++++++++---- tests/hlsl-clamp.shader_test | 8 +-- tests/hlsl-ldexp.shader_test | 8 +-- tests/hlsl-lerp.shader_test | 8 +-- tests/hlsl-smoothstep.shader_test | 14 ++--- tests/max.shader_test | 8 +-- tests/pow.shader_test | 2 +- 7 files changed, 126 insertions(+), 33 deletions(-)
1
0
0
0
Francisco Casas : tests: Test for common type conversion for element-wise intrinsics.
by Alexandre Julliard
11 Jan '23
11 Jan '23
Module: vkd3d Branch: master Commit: 86c35fc79da7c5206ed095c47ab7e3479a3a95e9 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/86c35fc79da7c5206ed095c47ab7e…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Mon Nov 7 11:54:11 2022 -0300 tests: Test for common type conversion for element-wise intrinsics. Some intrinsics have different rules for the allowed data types than expressions: - Vectors and matrices at the same time are not allowed, regardless of their dimensions. Even if they have the same number of components. - Any combination of matrices is always allowed, even those when no matrix fits inside another, e.g.: float2x3 is compatible with float3x2, resulting in float 2x2. The common data type is the min on each dimension. This is the case for max, pow, ldexp, clamp and smoothstep; which suggest that it is the case for all intrinsics where the operation is applied element-wise. Tests for mul() are also added as a counter-example where the operation is not element-wise. --- tests/hlsl-clamp.shader_test | 28 ++++++++++++++++++++++++++++ tests/hlsl-ldexp.shader_test | 26 ++++++++++++++++++++++++++ tests/hlsl-lerp.shader_test | 28 ++++++++++++++++++++++++++++ tests/hlsl-mul.shader_test | 30 ++++++++++++++++++++++++++++++ tests/max.shader_test | 27 +++++++++++++++++++++++++++ tests/pow.shader_test | 26 ++++++++++++++++++++++++++ 6 files changed, 165 insertions(+) diff --git a/tests/hlsl-clamp.shader_test b/tests/hlsl-clamp.shader_test index 8e26270c..cc198735 100644 --- a/tests/hlsl-clamp.shader_test +++ b/tests/hlsl-clamp.shader_test @@ -8,3 +8,31 @@ float4 main(uniform float3 u) : sv_target uniform 0 float4 -0.3 -0.1 0.7 0.0 draw quad probe all rgba (-0.1, 0.7, -0.3, 0.3) + + +[pixel shader todo] +float4 main() : sv_target +{ + float3x2 a = {6, 5, 4, 3, 2, 1}; + float2x3 b = {1, 2, 3, 4.2, 5.2, 6.2}; + float3x4 c = 5.5; + + float2x2 r = clamp(a, b, c); + return float4(r); +} + +[test] +todo draw quad +todo probe all rgba (5.5, 5.0, 4.2, 5.2) + + +[pixel shader fail todo] +float4 main() : sv_target +{ + float2x2 a = {3.1, 3.1, 3.1, 3.1}; + float2x2 b = {1, 2, 3, 4}; + float4 c = {5.5, 4.5, 3.5, 2.5}; + + clamp(a, b, c); + return 0; +} diff --git a/tests/hlsl-ldexp.shader_test b/tests/hlsl-ldexp.shader_test index 0873fc9e..bea97953 100644 --- a/tests/hlsl-ldexp.shader_test +++ b/tests/hlsl-ldexp.shader_test @@ -30,3 +30,29 @@ uniform 0 int4 2 3 4 5 uniform 4 int4 0 -10 10 100 draw quad probe all rgba (2.0, 0.00292968750, 4096.0, 6.33825300e+030) + + +[pixel shader todo] +float4 main() : sv_target +{ + float2x3 a = {1, 2, 3, 4, 5, 6}; + float3x2 b = {6, 5, 4, 3, 2, 1}; + + float2x2 r = ldexp(a, b); + return float4(r); +} + +[test] +todo draw quad +todo probe all rgba (64.0, 64.0, 64.0, 40.0) + + +[pixel shader fail todo] +float4 main() : sv_target +{ + float2x2 a = {1, 2, 3, 4}; + float1 b = {2}; + + ldexp(a, b); + return 0; +} diff --git a/tests/hlsl-lerp.shader_test b/tests/hlsl-lerp.shader_test index 3f93b02d..3cd10ec1 100644 --- a/tests/hlsl-lerp.shader_test +++ b/tests/hlsl-lerp.shader_test @@ -34,3 +34,31 @@ uniform 4 int4 0 -10 10 1000000 uniform 8 int4 0 1 -1 1000000 draw quad probe all rgba (2.0, -10.0, -2.0, 1e12) + + +[pixel shader todo] +float4 main() : sv_target +{ + float3x2 a = {6, 5, 4, 3, 2, 1}; + float2x3 b = {1, 2, 3, 4.2, 5.2, 6.2}; + float3x4 c = 2.4; + + float2x2 r = lerp(a, b, c); + return float4(r); +} + +[test] +todo draw quad +todo probe all rgba (-6.0, -2.2, 4.48, 8.28) + + +[pixel shader fail todo] +float4 main() : sv_target +{ + float2x2 a = {0, 1, 2, 3}; + float2x2 b = {1, 2, 3, 4}; + float4 c = {0.5, 0.5, 0.5, 0.5}; + + lerp(a, b, c); + return 0; +} diff --git a/tests/hlsl-mul.shader_test b/tests/hlsl-mul.shader_test index 7b453187..cb104a9e 100644 --- a/tests/hlsl-mul.shader_test +++ b/tests/hlsl-mul.shader_test @@ -288,3 +288,33 @@ float4 main(float4 pos : sv_position) : sv_target [test] draw quad probe all rgba (78.0, 96.0, 114.0, 0.0) + + +[pixel shader] +float4 main() : sv_target +{ + float2x3 a = float2x3(1, 2, 3, 4, 5, 6); + float3x2 b = float3x2(6, 5, 4, 3, 2, 1); + + float2x2 r = mul(a, b); + return float4(r); +} + +[test] +draw quad +probe all rgba (20.0, 14.0, 56.0, 41.0) + + +[pixel shader] +float4 main() : sv_target +{ + float2x2 a = float2x2(1, 2, 3, 4); + float2 b = float2(1, 2); + + float2 r = mul(a, b); + return float4(r, 0, 0); +} + +[test] +draw quad +probe all rgba (5.0, 11.0, 0.0, 0.0) diff --git a/tests/max.shader_test b/tests/max.shader_test index 50083f33..7a917ec5 100644 --- a/tests/max.shader_test +++ b/tests/max.shader_test @@ -9,6 +9,7 @@ uniform 0 float4 0.7 -0.1 0.0 0.0 draw quad probe all rgba (0.7, 2.1, 2.0, -1.0) + [pixel shader] float4 main(uniform float4 u) : sv_target { @@ -21,3 +22,29 @@ float4 main(uniform float4 u) : sv_target uniform 0 float4 0.7 -0.1 0.4 0.8 draw quad probe all rgba (0.7, 0.8, 0.7, 0.2) + + +[pixel shader todo] +float4 main() : sv_target +{ + float2x3 a = {1, 2, 3, 4, 5, 6}; + float3x2 b = {6, 5, 4, 3, 2, 1}; + + float2x2 r = max(a, b); + return float4(r); +} + +[test] +todo draw quad +todo probe all rgba (6.0, 5.0, 4.0, 5.0) + + +[pixel shader fail todo] +float4 main() : sv_target +{ + float2x2 a = {1, 2, 3, 4}; + float4 b = {4, 3, 2, 1}; + + max(a, b); + return 0; +} diff --git a/tests/pow.shader_test b/tests/pow.shader_test index 6470494e..6f2b2741 100644 --- a/tests/pow.shader_test +++ b/tests/pow.shader_test @@ -8,3 +8,29 @@ float4 main(uniform float4 u) : sv_target uniform 0 float4 0.4 0.8 2.5 2.0 draw quad probe all rgba (0.512, 0.101192884, 0.64, 0.25) 4 + + +[pixel shader todo] +float4 main() : sv_target +{ + float2x3 a = {1, 2, 3, 4, 5, 6}; + float3x2 b = {6, 5, 4, 3, 2, 1}; + + float2x2 r = pow(a, b); + return float4(r); +} + +[test] +todo draw quad +todo probe all rgba (1.0, 32.0, 256.0, 125.0) + + +[pixel shader fail todo] +float4 main() : sv_target +{ + float2x2 a = {1, 2, 3, 4}; + float4 b = {1, 2, 3, 4}; + + pow(a, b); + return 0; +}
1
0
0
0
Francisco Casas : vkd3d-shader/hlsl: Support smoothstep() intrinsic.
by Alexandre Julliard
11 Jan '23
11 Jan '23
Module: vkd3d Branch: master Commit: a7bb5a0835d4008553aa3f405fe989270fb0a5c1 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/a7bb5a0835d4008553aa3f405fe98…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Thu Nov 3 20:54:48 2022 -0300 vkd3d-shader/hlsl: Support smoothstep() intrinsic. --- Makefile.am | 1 + libs/vkd3d-shader/hlsl.y | 77 ++++++++++++++++++ tests/hlsl-smoothstep.shader_test | 166 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 244 insertions(+) diff --git a/Makefile.am b/Makefile.am index ff817f0a..9459bad9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -102,6 +102,7 @@ vkd3d_shader_tests = \ tests/hlsl-return-void.shader_test \ tests/hlsl-shape.shader_test \ tests/hlsl-single-numeric-initializer.shader_test \ + tests/hlsl-smoothstep.shader_test \ tests/hlsl-state-block-syntax.shader_test \ tests/hlsl-static-initializer.shader_test \ tests/hlsl-storage-qualifiers.shader_test \ diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index a18394a6..82a9711b 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2596,6 +2596,82 @@ static bool intrinsic_saturate(struct hlsl_ctx *ctx, return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_SAT, arg, loc); } +/* smoothstep(a, b, x) = p^2 (3 - 2p), where p = saturate((x - a)/(b - a)) */ +static bool intrinsic_smoothstep(struct hlsl_ctx *ctx, + const struct parse_initializer *params, const struct vkd3d_shader_location *loc) +{ + struct hlsl_ir_node *min_arg, *max_arg, *x_arg, *p, *p_num, *p_denom, *res; + struct hlsl_ir_constant *one, *minus_two, *three; + enum hlsl_type_class common_class; + struct hlsl_type *common_type; + unsigned int dimx, dimy; + + min_arg = params->args[0]; + max_arg = params->args[1]; + x_arg = params->args[2]; + + if (!expr_common_shape(ctx, min_arg->data_type, max_arg->data_type, loc, &common_class, &dimx, &dimy)) + return false; + common_type = hlsl_get_numeric_type(ctx, common_class, HLSL_TYPE_FLOAT, dimx, dimy); + + if (!expr_common_shape(ctx, common_type, x_arg->data_type, loc, &common_class, &dimx, &dimy)) + return false; + common_type = hlsl_get_numeric_type(ctx, common_class, HLSL_TYPE_FLOAT, dimx, dimy); + + if (!(min_arg = add_implicit_conversion(ctx, params->instrs, min_arg, common_type, loc))) + return false; + + if (!(max_arg = add_implicit_conversion(ctx, params->instrs, max_arg, common_type, loc))) + return false; + + if (!(x_arg = add_implicit_conversion(ctx, params->instrs, x_arg, common_type, loc))) + return false; + + if (!(min_arg = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_NEG, min_arg, loc))) + return false; + + if (!(p_num = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_ADD, x_arg, min_arg, loc))) + return false; + + if (!(p_denom = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_ADD, max_arg, min_arg, loc))) + return false; + + if (!(one = hlsl_new_float_constant(ctx, 1.0, loc))) + return false; + list_add_tail(params->instrs, &one->node.entry); + + if (!(p_denom = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_DIV, &one->node, p_denom, loc))) + return false; + + if (!(p = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, p_num, p_denom, loc))) + return false; + + if (!(p = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_SAT, p, loc))) + return false; + + if (!(minus_two = hlsl_new_float_constant(ctx, -2.0, loc))) + return false; + list_add_tail(params->instrs, &minus_two->node.entry); + + if (!(three = hlsl_new_float_constant(ctx, 3.0, loc))) + return false; + list_add_tail(params->instrs, &three->node.entry); + + if (!(res = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, &minus_two->node, p, loc))) + return false; + + if (!(res = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_ADD, &three->node, res, loc))) + return false; + + if (!(p = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, p, p, loc))) + return false; + + if (!(res = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, p, res, loc))) + return false; + + return true; +} + static bool intrinsic_transpose(struct hlsl_ctx *ctx, const struct parse_initializer *params, const struct vkd3d_shader_location *loc) { @@ -2681,6 +2757,7 @@ intrinsic_functions[] = {"pow", 2, true, intrinsic_pow}, {"round", 1, true, intrinsic_round}, {"saturate", 1, true, intrinsic_saturate}, + {"smoothstep", 3, true, intrinsic_smoothstep}, {"transpose", 1, true, intrinsic_transpose}, }; diff --git a/tests/hlsl-smoothstep.shader_test b/tests/hlsl-smoothstep.shader_test new file mode 100644 index 00000000..fc1c856a --- /dev/null +++ b/tests/hlsl-smoothstep.shader_test @@ -0,0 +1,166 @@ + + +[pixel shader] +float4 main() : sv_target +{ + float4 a = {1, -1, -1, 10}; + float4 b = {2, 1, 1, 20}; + float4 x = {0.3, 0.4, 2, 15.4}; + + return smoothstep(a, b, x); +} + +[test] +draw quad +probe all rgba (0, 0.784, 1.0, 0.559872) 1 + + +[pixel shader] +float4 main() : sv_target +{ + float a = 1; + float b = 2; + float4 x = {0.9, 1.2, 1.8, 2.1}; + + return smoothstep(a, b, x); +} + +[test] +draw quad +probe all rgba (0, 0.104, 0.896, 1.000000) 5 + + +[pixel shader] +float4 main() : sv_target +{ + float4 a = {1, 10, 100, 1000}; + float4 b = {2, 20, 200, 2000}; + float x = 14; + + return smoothstep(a, b, x); +} + +[test] +draw quad +probe all rgba (1.0, 0.352, 0, 0) 1 + + +[pixel shader] +float4 main() : sv_target +{ + float2 a = {1, 10}; + float3 b = {2, 20, 200}; + float4 x = {1.4, 14, 140, 1400}; + + float2 res = smoothstep(a, b, x); + return float4(res, 0, 0); +} + +[test] +draw quad +probe all rgba (0.352, 0.352, 0, 0) 1 + + +[pixel shader] +float4 main() : sv_target +{ + float3 a = {1, 10, 100}; + float2 b = {2, 20}; + float4 x = {1.4, 14, 140, 1400}; + + float2 res = smoothstep(a, b, x); + return float4(res, 0, 0); +} + +[test] +draw quad +probe all rgba (0.352, 0.352, 0, 0) 1 + + +[pixel shader] +float4 main() : sv_target +{ + float4 a = {1, 10, 100, 1000}; + float4 b = {2, 20, 200, 2000}; + float2 x = {14, 140}; + + float2 res = smoothstep(a, b, x); + return float4(res, 0, 0); +} + +[test] +draw quad +probe all rgba (1.0, 1.0, 0, 0) 1 + + +[pixel shader todo] +float4 main() : sv_target +{ + float2x3 a = {1, 1, 1, 1, 1, 1}; + float3x2 b = {2, 2, 2, 2, 2, 2}; + float4x2 x = {1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8}; + + float2x2 r = smoothstep(a, b, x); + return r; +} + +[test] +todo draw quad +todo probe all rgba (0.028, 0.104, 0.216, 0.352) 1 + + +[pixel shader] +// 4 division by zero warnings. +// Only test compilation because result is implementation-dependent. +float4 main() : sv_target +{ + float4 a = {0, 0, 0, 0}; + float4 b = {-1, -1, 0, 0}; + float4 x = {0, -0.25, 0, 1}; + + return smoothstep(a, b, x); +} + + +[pixel shader] +float4 main() : sv_target +{ + float4x1 a = {0.0, 0.0, 0.0, 0.0}; + float b = 1.0; + float3x1 x = {0.5, 0.5, 0.5}; + + float3x1 r = smoothstep(a, b, x); + return float4(r, 0); +} + +[test] +draw quad +probe all rgba (0.5, 0.5, 0.5, 0.0) + + +[pixel shader todo] +float4 main() : sv_target +{ + float4x1 a = {0.0, 0.0, 0.0, 0.0}; + float2x2 b = {1.0, 1.0, 1.0, 1.0}; + float3x1 x = {0.5, 0.5, 0.5}; + + float2x1 r = smoothstep(a, b, x); + return float4(r, r); +} + +[test] +todo draw quad +todo probe all rgba (0.5, 0.5, 0.5, 0.5) + + +[pixel shader fail todo] +float4 main() : sv_target +{ + float2x2 a = {0.0, 0.0, 0.0, 0.0}; + float4 b = 1.0; + float2x2 x = {0.5, 0.5, 0.5, 0.5}; + + smoothstep(a, b, x); + return 0; +}
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
47
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
Results per page:
10
25
50
100
200