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 2023
----- 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
599 discussions
Start a n
N
ew thread
Francisco Casas : tests: Test array parameters on functions.
by Alexandre Julliard
20 Feb '23
20 Feb '23
Module: vkd3d Branch: master Commit: 9df54851c958819cb82f92506a9d37e7d7ab87e2 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/9df54851c958819cb82f92506a9d3…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Thu Jan 26 11:40:02 2023 -0300 tests: Test array parameters on functions. --- Makefile.am | 1 + tests/array-parameters.shader_test | 161 +++++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+) diff --git a/Makefile.am b/Makefile.am index 1f892ef9..5eadfc29 100644 --- a/Makefile.am +++ b/Makefile.am @@ -49,6 +49,7 @@ vkd3d_shader_tests = \ tests/arithmetic-int.shader_test \ tests/arithmetic-int-uniform.shader_test \ tests/arithmetic-uint.shader_test \ + tests/array-parameters.shader_test \ tests/bitwise.shader_test \ tests/cast-broadcast.shader_test \ tests/cast-componentwise-equal.shader_test \ diff --git a/tests/array-parameters.shader_test b/tests/array-parameters.shader_test new file mode 100644 index 00000000..615aa3f4 --- /dev/null +++ b/tests/array-parameters.shader_test @@ -0,0 +1,161 @@ +[pixel shader todo] +float fun(float a[2]) +{ + return 10 * a[0] + a[1]; +} + +float4 main() : sv_target +{ + float f[2] = {2, 5}; + + return fun(f); +} + +[test] +todo draw quad +todo probe all rgba (25.0, 25.0, 25.0, 25.0) + + +[pixel shader fail] +float fun(float a[2]) +{ + return 0; +} + +float4 main() : sv_target +{ + int f[2] = {2, 5}; + + return fun(f); +} + + +[pixel shader fail] +float fun(float a[1]) +{ + return 0; +} + +float4 main() : sv_target +{ + float f = 4; + + return fun(f); +} + + +[pixel shader fail] +float fun(int a[2]) +{ + return 0; +} + +float4 main() : sv_target +{ + float f[2] = {1, 2}; + + return fun(f); +} + + +[pixel shader todo] +float4 fun(float a[2][4]) +{ + float4 res; + + res.x = 10 * a[0][0] + a[1][0]; + res.y = 10 * a[0][1] + a[1][1]; + res.z = 10 * a[0][2] + a[1][2]; + res.w = 10 * a[0][3] + a[1][3]; + return res; +} + +float4 main() : sv_target +{ + float f[2][4] = {1, 2, 3, 4, 5, 6, 7, 8}; + + return fun(f); +} + +[test] +todo draw quad +todo probe all rgba (15.0, 26.0, 37.0, 48.0) + + +[pixel shader fail] +float fun(float a[2]) +{ + return 0; +} + +float4 main() : sv_target +{ + float f[3] = {1, 2, 3}; + + return fun(f); +} + + +% Implicit size arrays are not allowed. +[pixel shader fail] +float fun(float a[]) +{ + return 0; +} + +float4 main() : sv_target +{ + float f[2] = {1, 2}; + + return fun(f); +} + +[pixel shader fail] +float4 fun(float a[4]) +{ + return 0; +} + +float4 main() : sv_target +{ + float4 v = {1, 2, 3, 4}; + + return fun(v); +} + + +% Arrays with the same number of components are allowed. +[pixel shader todo] +float fun(float a[2][3]) +{ + return 100*a[0][0] + 10*a[0][2] + a[1][2]; +} + +float4 main() : sv_target +{ + float f[3][2] = {1, 2, 3, 4, 5, 6}; + + return fun(f); +} + +[test] +todo draw quad +todo probe all rgba (136.0, 136.0, 136.0, 136.0) + + +[pixel shader todo] +float fun(float a[2][3]) +{ + return 100*a[0][0] + 10*a[1][0] + a[1][2]; +} + +float4 main() : sv_target +{ + float f[6] = {7, 8, 9, 0, 1, 2}; + + return fun(f); +} + +[test] +todo draw quad +todo probe all rgba (702.0, 702.0, 702.0, 702.0)
1
0
0
0
Francisco Casas : tests: Add more tests for broadcasts in function call args.
by Alexandre Julliard
20 Feb '23
20 Feb '23
Module: vkd3d Branch: master Commit: 1b951c87f610b0bbee541817219ef5b6ed5e3386 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/1b951c87f610b0bbee541817219ef…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Mon Jan 23 18:27:26 2023 -0300 tests: Add more tests for broadcasts in function call args. --- tests/cast-broadcast.shader_test | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/cast-broadcast.shader_test b/tests/cast-broadcast.shader_test index d8571fc8..a7462e76 100644 --- a/tests/cast-broadcast.shader_test +++ b/tests/cast-broadcast.shader_test @@ -55,6 +55,18 @@ float4 main() : SV_TARGET } +[pixel shader fail] +float4 fun(float f[7]) +{ + return f[1]; +} + +float4 main() : SV_TARGET +{ + return fun(32); +} + + [pixel shader fail] struct apple { @@ -68,3 +80,19 @@ float4 PSMain() : SV_TARGET a1 = (struct apple)1; return a1.foo; } + + +[pixel shader todo] +float4 fun(float3 f) +{ + return f.xyxy; +} + +float4 main() : SV_TARGET +{ + return fun(33); +} + +[test] +todo draw quad +todo probe all rgba (33.0, 33.0, 33.0, 33.0)
1
0
0
0
Francisco Casas : vkd3d-shader/hlsl: Rename compatible_data_types() to be more specific.
by Alexandre Julliard
20 Feb '23
20 Feb '23
Module: vkd3d Branch: master Commit: 2a9b9f75302830c4b230fcfe818fe12f7a4948fe URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/2a9b9f75302830c4b230fcfe818fe…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Thu Jan 26 12:16:22 2023 -0300 vkd3d-shader/hlsl: Rename compatible_data_types() to be more specific. --- libs/vkd3d-shader/hlsl.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index eec76a6a..9967db98 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -217,7 +217,7 @@ static bool type_contains_only_numerics(struct hlsl_type *type) return type->type <= HLSL_CLASS_LAST_NUMERIC; } -static bool compatible_data_types(struct hlsl_ctx *ctx, struct hlsl_type *src, struct hlsl_type *dst) +static bool explicit_compatible_data_types(struct hlsl_ctx *ctx, struct hlsl_type *src, struct hlsl_type *dst) { if (src->type <= HLSL_CLASS_LAST_NUMERIC && src->dimx == 1 && src->dimy == 1 && type_contains_only_numerics(dst)) return true; @@ -5240,7 +5240,7 @@ unary_expr: dst_type = hlsl_new_array_type(ctx, dst_type, $4.sizes[i]); } - if (!compatible_data_types(ctx, src_type, dst_type)) + if (!explicit_compatible_data_types(ctx, src_type, dst_type)) { struct vkd3d_string_buffer *src_string, *dst_string;
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Avoid warning for each variable when in/out modifiers are specified on non-parameters.
by Alexandre Julliard
20 Feb '23
20 Feb '23
Module: vkd3d Branch: master Commit: 6767b7abbf0cf8ea1be170ca2df6c9c6f98f2ea4 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/6767b7abbf0cf8ea1be170ca2df6c…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Apr 6 13:55:34 2022 -0500 vkd3d-shader/hlsl: Avoid warning for each variable when in/out modifiers are specified on non-parameters. --- libs/vkd3d-shader/hlsl.y | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index e158f1de..eec76a6a 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -1940,10 +1940,11 @@ static bool type_has_numeric_components(struct hlsl_type *type) } static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_type, - DWORD modifiers, struct list *var_list) + unsigned int modifiers, const struct vkd3d_shader_location *modifiers_loc, struct list *var_list) { struct parse_variable_def *v, *v_next; struct hlsl_ir_function_decl *func; + unsigned int invalid_modifiers; struct list *statements_list; struct hlsl_ir_var *var; struct hlsl_type *type; @@ -1963,6 +1964,17 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t if (!var_list) return statements_list; + invalid_modifiers = modifiers & (HLSL_STORAGE_IN | HLSL_STORAGE_OUT); + if (invalid_modifiers) + { + struct vkd3d_string_buffer *string; + + if ((string = hlsl_modifiers_to_string(ctx, invalid_modifiers))) + hlsl_error(ctx, modifiers_loc, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER, + "Modifiers '%s' are not allowed on non-parameter variables.", string->buffer); + hlsl_release_string_buffer(ctx, string); + } + LIST_FOR_EACH_ENTRY_SAFE(v, v_next, var_list, struct parse_variable_def, entry) { bool unbounded_res_array = false; @@ -2039,16 +2051,6 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t } vkd3d_free(v->arrays.sizes); - if (modifiers & (HLSL_STORAGE_IN | HLSL_STORAGE_OUT)) - { - struct vkd3d_string_buffer *string; - - if ((string = hlsl_modifiers_to_string(ctx, modifiers & (HLSL_STORAGE_IN | HLSL_STORAGE_OUT)))) - hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER, - "Modifiers '%s' are not allowed on non-parameter variables.", string->buffer); - hlsl_release_string_buffer(ctx, string); - } - if (!(var = hlsl_new_var(ctx, v->name, type, v->loc, &v->semantic, modifiers, &v->reg_reservation))) { free_parse_variable_def(v); @@ -3862,7 +3864,7 @@ struct_declaration: if (!(type = apply_type_modifiers(ctx, $2, &modifiers, @1))) YYABORT; - $$ = declare_vars(ctx, type, modifiers, $3); + $$ = declare_vars(ctx, type, modifiers, &@1, $3); } struct_spec: @@ -4585,7 +4587,7 @@ declaration: if (!(type = apply_type_modifiers(ctx, $2, &modifiers, @1))) YYABORT; - $$ = declare_vars(ctx, type, modifiers, $3); + $$ = declare_vars(ctx, type, modifiers, &@1, $3); } variables_def_optional:
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Remove a redundant warning for mutually exclusive majority modifiers.
by Alexandre Julliard
20 Feb '23
20 Feb '23
Module: vkd3d Branch: master Commit: 72ec5563f87dbcb59bc2db18c7708b88bf9597e6 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/72ec5563f87dbcb59bc2db18c7708…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Mar 29 17:03:59 2022 -0500 vkd3d-shader/hlsl: Remove a redundant warning for mutually exclusive majority modifiers. We will warn subsequently in apply_type_modifiers() or add_typedef(). --- libs/vkd3d-shader/hlsl.y | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index da78d291..e158f1de 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -408,12 +408,6 @@ static DWORD add_modifiers(struct hlsl_ctx *ctx, DWORD modifiers, DWORD mod, con hlsl_release_string_buffer(ctx, string); return modifiers; } - if ((mod & HLSL_MODIFIERS_MAJORITY_MASK) && (modifiers & HLSL_MODIFIERS_MAJORITY_MASK)) - { - hlsl_error(ctx, &loc, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER, - "'row_major' and 'column_major' modifiers are mutually exclusive."); - return modifiers; - } return modifiers | mod; }
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Check for majority modifiers on non-matrices in apply_type_modifiers().
by Alexandre Julliard
20 Feb '23
20 Feb '23
Module: vkd3d Branch: master Commit: af652874236825405ac5e4a26333b79d98f2aa76 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/af652874236825405ac5e4a26333b…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Mar 29 16:56:03 2022 -0500 vkd3d-shader/hlsl: Check for majority modifiers on non-matrices in apply_type_modifiers(). --- libs/vkd3d-shader/hlsl.y | 7 ++++--- tests/majority-syntax.shader_test | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 2b62eccf..da78d291 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -903,6 +903,10 @@ static struct hlsl_type *apply_type_modifiers(struct hlsl_ctx *ctx, struct hlsl_ else default_majority = HLSL_MODIFIER_ROW_MAJOR; } + else if (type->type != HLSL_CLASS_MATRIX) + { + check_invalid_matrix_modifiers(ctx, *modifiers, loc); + } if (!default_majority && !(*modifiers & HLSL_TYPE_MODIFIERS_MASK)) return type; @@ -2041,9 +2045,6 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t } vkd3d_free(v->arrays.sizes); - if (type->type != HLSL_CLASS_MATRIX) - check_invalid_matrix_modifiers(ctx, modifiers, v->loc); - if (modifiers & (HLSL_STORAGE_IN | HLSL_STORAGE_OUT)) { struct vkd3d_string_buffer *string; diff --git a/tests/majority-syntax.shader_test b/tests/majority-syntax.shader_test index 63ba18f3..4ab385a5 100644 --- a/tests/majority-syntax.shader_test +++ b/tests/majority-syntax.shader_test @@ -48,7 +48,7 @@ float4 main() : sv_target return 0; } -[pixel shader fail todo] +[pixel shader fail] column_major float4 f; float4 main() : sv_target @@ -68,7 +68,7 @@ float4 main() : sv_target return 0; } -[pixel shader fail todo] +[pixel shader fail] struct apple { float4x4 m; @@ -80,7 +80,7 @@ float4 main() : sv_target return 0; } -[pixel shader fail todo] +[pixel shader fail] typedef float4x4 myarray_t[2]; row_major myarray_t a; @@ -90,13 +90,13 @@ float4 main() : sv_target return 0; } -[pixel shader fail todo] +[pixel shader fail] float4 main(uniform row_major float4 f) : sv_target { return 0; } -[pixel shader fail todo] +[pixel shader fail] struct apple { row_major float4 f;
1
0
0
0
Zebediah Figura : tests: Add more tests for majority modifier syntax.
by Alexandre Julliard
20 Feb '23
20 Feb '23
Module: vkd3d Branch: master Commit: 1ee7a4e82a6fbd97844008d0eddba409065efc9e URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/1ee7a4e82a6fbd97844008d0eddba…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Mar 29 16:50:33 2022 -0500 tests: Add more tests for majority modifier syntax. --- Makefile.am | 1 + tests/hlsl-invalid.shader_test | 18 ------- tests/majority-syntax.shader_test | 108 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 18 deletions(-) diff --git a/Makefile.am b/Makefile.am index c5c75bef..1f892ef9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -117,6 +117,7 @@ vkd3d_shader_tests = \ tests/hlsl-vector-indexing.shader_test \ tests/hlsl-vector-indexing-uniform.shader_test \ tests/logic-operations.shader_test \ + tests/majority-syntax.shader_test \ tests/math.shader_test \ tests/matrix-semantics.shader_test \ tests/max.shader_test \ diff --git a/tests/hlsl-invalid.shader_test b/tests/hlsl-invalid.shader_test index e56205cb..ad062652 100644 --- a/tests/hlsl-invalid.shader_test +++ b/tests/hlsl-invalid.shader_test @@ -86,15 +86,6 @@ uniform float4 main() : sv_target return 0; } -[pixel shader fail] -typedef row_major float4x4 matrix_t; -typedef column_major matrix_t matrix2_t; - -float4 main() : sv_target -{ - return 0; -} - [pixel shader fail] float4 main() { @@ -228,15 +219,6 @@ float4 main() : sv_target return float4(0, 0, 0, 0); } -[pixel shader fail] -typedef row_major float4x4 mat_t; -column_major mat_t m; - -float4 main() : sv_target -{ - return float4(0, 0, 0, 0); -} - [pixel shader fail] typedef struct apple { diff --git a/tests/majority-syntax.shader_test b/tests/majority-syntax.shader_test new file mode 100644 index 00000000..63ba18f3 --- /dev/null +++ b/tests/majority-syntax.shader_test @@ -0,0 +1,108 @@ +[pixel shader] +typedef row_major float2x2 mat_t; + +row_major mat_t m; + +float4 main() : sv_target +{ + return float4(m[0], m[1]); +} + +[test] +uniform 0 float4 0.1 0.3 0.0 0.0 +uniform 4 float4 0.2 0.4 0.0 0.0 +draw quad +probe all rgba (0.1, 0.3, 0.2, 0.4) + +[pixel shader fail] +row_major row_major float4x4 m; + +float4 main() : sv_target +{ + return float4(0, 0, 0, 0); +} + +[pixel shader fail] +typedef row_major float4x4 mat_t; +column_major mat_t m; + +float4 main() : sv_target +{ + return float4(0, 0, 0, 0); +} + +[pixel shader fail] +typedef row_major float4x4 matrix_t; +typedef column_major matrix_t matrix2_t; + +float4 main() : sv_target +{ + return 0; +} + +[pixel shader fail] +typedef column_major float4 myfloat_t; + +float4 main() : sv_target +{ + return 0; +} + +[pixel shader fail todo] +column_major float4 f; + +float4 main() : sv_target +{ + return 0; +} + +[pixel shader fail] +struct apple +{ + float4x4 m; +}; +typedef column_major struct apple apple_t; + +float4 main() : sv_target +{ + return 0; +} + +[pixel shader fail todo] +struct apple +{ + float4x4 m; +}; +column_major struct apple a; + +float4 main() : sv_target +{ + return 0; +} + +[pixel shader fail todo] +typedef float4x4 myarray_t[2]; + +row_major myarray_t a; + +float4 main() : sv_target +{ + return 0; +} + +[pixel shader fail todo] +float4 main(uniform row_major float4 f) : sv_target +{ + return 0; +} + +[pixel shader fail todo] +struct apple +{ + row_major float4 f; +}; + +float4 main() : sv_target +{ + return 0; +}
1
0
0
0
Zebediah Figura : tests: Test macro expansion in pack_matrix pragmas.
by Alexandre Julliard
20 Feb '23
20 Feb '23
Module: vkd3d Branch: master Commit: 1c29b45c1fa7474ebd1c0d0a63084290df8c1f2a URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/1c29b45c1fa7474ebd1c0d0a63084…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Sep 14 18:07:10 2021 -0500 tests: Test macro expansion in pack_matrix pragmas. --- tests/hlsl-majority-pragma.shader_test | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/hlsl-majority-pragma.shader_test b/tests/hlsl-majority-pragma.shader_test index e7fc75cd..d269e859 100644 --- a/tests/hlsl-majority-pragma.shader_test +++ b/tests/hlsl-majority-pragma.shader_test @@ -19,3 +19,31 @@ uniform 8 float4 0.1 0.3 0.0 0.0 uniform 12 float4 0.2 0.4 0.0 0.0 draw quad probe all rgba (0.17, 0.39, 0.17, 0.39) 1 + +% The documentation claims these strings are subject to macro expansion. +% They are not. + +[pixel shader] + +#define KEY pack_matrix +#pragma KEY(row_major) +#define VALUE row_major +#pragma pack_matrix(VALUE) +#define PRAGMA pack_matrix(row_major) +#pragma PRAGMA + +uniform float2x2 r; + +float4 main() : sv_target +{ + float4 ret; + ret.xy = mul(r, float2(0.5, 0.6)); + ret.zw = 0.5; + return ret; +} + +[test] +uniform 0 float4 0.1 0.2 0.0 0.0 +uniform 4 float4 0.3 0.4 0.0 0.0 +draw quad +probe all rgba (0.23, 0.34, 0.5, 0.5) 1
1
0
0
0
Nikolay Sivov : vkd3d-shader/hlsl: Support all() intrinsic.
by Alexandre Julliard
20 Feb '23
20 Feb '23
Module: vkd3d Branch: master Commit: e5b40092c21da07bab2506cadb0fa6c7c5bb2b96 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/e5b40092c21da07bab2506cadb0fa…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Feb 15 19:38:47 2023 +0100 vkd3d-shader/hlsl: Support all() intrinsic. --- Makefile.am | 1 + libs/vkd3d-shader/hlsl.y | 32 ++++++++++++++++++++++++ tests/all.shader_test | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) diff --git a/Makefile.am b/Makefile.am index 8822e9eb..c5c75bef 100644 --- a/Makefile.am +++ b/Makefile.am @@ -43,6 +43,7 @@ vkd3d_cross_tests = \ vkd3d_shader_tests = \ tests/abs.shader_test \ + tests/all.shader_test \ tests/arithmetic-float.shader_test \ tests/arithmetic-float-uniform.shader_test \ tests/arithmetic-int.shader_test \ diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 2f001611..2b62eccf 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2370,6 +2370,37 @@ static bool intrinsic_abs(struct hlsl_ctx *ctx, return !!add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_ABS, params->args[0], loc); } +static bool intrinsic_all(struct hlsl_ctx *ctx, + const struct parse_initializer *params, const struct vkd3d_shader_location *loc) +{ + struct hlsl_ir_node *arg = params->args[0], *mul; + struct hlsl_ir_constant *one, *zero; + struct hlsl_ir_load *load; + unsigned int i, count; + + if (!(one = hlsl_new_float_constant(ctx, 1.0f, loc))) + return false; + list_add_tail(params->instrs, &one->node.entry); + + if (!(zero = hlsl_new_float_constant(ctx, 0.0f, loc))) + return false; + list_add_tail(params->instrs, &zero->node.entry); + + mul = &one->node; + + count = hlsl_type_component_count(arg->data_type); + for (i = 0; i < count; ++i) + { + if (!(load = add_load_component(ctx, params->instrs, arg, i, loc))) + return false; + + if (!(mul = add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_MUL, &load->node, mul, loc))) + return false; + } + + return !!add_binary_comparison_expr(ctx, params->instrs, HLSL_OP2_NEQUAL, mul, &zero->node, loc); +} + /* Find the type corresponding to the given source type, with the same * dimensions but a different base type. */ static struct hlsl_type *convert_numeric_type(const struct hlsl_ctx *ctx, @@ -2986,6 +3017,7 @@ intrinsic_functions[] = { /* Note: these entries should be kept in alphabetical order. */ {"abs", 1, true, intrinsic_abs}, + {"all", 1, true, intrinsic_all}, {"asuint", -1, true, intrinsic_asuint}, {"clamp", 3, true, intrinsic_clamp}, {"cos", 1, true, intrinsic_cos}, diff --git a/tests/all.shader_test b/tests/all.shader_test new file mode 100644 index 00000000..7bdb0dc8 --- /dev/null +++ b/tests/all.shader_test @@ -0,0 +1,63 @@ +[require] +shader model >= 4.0 + +[pixel shader] +uniform float4 f; + +float4 main() : sv_target +{ + return all(f); +} + +[test] +uniform 0 float4 -1.1 1.6 1.3 0.5 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 float4 0.0 1.6 1.3 0.5 +draw quad +probe all rgba (0.0, 0.0, 0.0, 0.0) + +[test] +uniform 0 float4 1.0 0.0 1.3 0.5 +draw quad +probe all rgba (0.0, 0.0, 0.0, 0.0) + +[pixel shader] +uniform float f; + +float4 main() : sv_target +{ + return all(f); +} + +[test] +uniform 0 float4 1.0 0.0 0.0 0.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 float4 0.0 0.0 0.0 0.0 +draw quad +probe all rgba (0.0, 0.0, 0.0, 0.0) + +[pixel shader] +uniform float2x2 f; + +float4 main() : sv_target +{ + return all(f); +} + +[test] +uniform 0 float4 1.0 2.0 0.0 0.0 +uniform 4 float4 3.0 4.0 0.0 0.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) + +[test] +uniform 0 float4 1.0 2.0 0.0 0.0 +uniform 4 float4 0.0 4.0 0.0 0.0 +draw quad +probe all rgba (0.0, 0.0, 0.0, 0.0)
1
0
0
0
Francisco Casas : vkd3d-shader/hlsl: Fix number of components when creating a swizzle in copy-prop.
by Alexandre Julliard
20 Feb '23
20 Feb '23
Module: vkd3d Branch: master Commit: 2142d31f132f4f0fe9e0c15dd996ec52276fb88a URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/2142d31f132f4f0fe9e0c15dd996e…
Author: Francisco Casas <fcasas(a)codeweavers.com> Date: Tue Feb 14 19:01:18 2023 -0300 vkd3d-shader/hlsl: Fix number of components when creating a swizzle in copy-prop. Otherwise we may create nodes of different dimensions than the ones we are replacing. "count" is the number of components of the source deref (without considering the swizzle), while "instr_component_count" is the actual number of components of the instruction to be replaced. --- libs/vkd3d-shader/hlsl.c | 3 +++ libs/vkd3d-shader/hlsl_codegen.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 5dbdaf7e..d6a87b3f 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -2306,6 +2306,9 @@ void hlsl_replace_node(struct hlsl_ir_node *old, struct hlsl_ir_node *new) { struct hlsl_src *src, *next; + assert(old->data_type->dimx == new->data_type->dimx); + assert(old->data_type->dimy == new->data_type->dimy); + LIST_FOR_EACH_ENTRY_SAFE(src, next, &old->uses, struct hlsl_src, entry) { hlsl_src_remove(src); diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 80d52dfc..87559502 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -1031,7 +1031,7 @@ static bool copy_propagation_replace_with_single_instr(struct hlsl_ctx *ctx, { struct hlsl_ir_swizzle *swizzle_node; - if (!(swizzle_node = hlsl_new_swizzle(ctx, ret_swizzle, count, new_instr, &instr->loc))) + if (!(swizzle_node = hlsl_new_swizzle(ctx, ret_swizzle, instr_component_count, new_instr, &instr->loc))) return false; list_add_before(&instr->entry, &swizzle_node->node.entry); new_instr = &swizzle_node->node;
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
60
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
Results per page:
10
25
50
100
200