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
May 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
775 discussions
Start a n
N
ew thread
Nikolay Sivov : vkd3d-shader/hlsl: Implement asfloat().
by Alexandre Julliard
02 May '23
02 May '23
Module: vkd3d Branch: master Commit: 87037d37482ea9664462edaaa8c0a4c435e28e90 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/87037d37482ea9664462edaaa8c0a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Apr 30 04:02:09 2023 +0200 vkd3d-shader/hlsl: Implement asfloat(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- Makefile.am | 1 + libs/vkd3d-shader/hlsl.y | 24 ++++++++++++++++++++++++ tests/asfloat.shader_test | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) diff --git a/Makefile.am b/Makefile.am index e8375cad..f7c5c9a1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,6 +51,7 @@ vkd3d_shader_tests = \ tests/arithmetic-int-uniform.shader_test \ tests/arithmetic-uint.shader_test \ tests/array-parameters.shader_test \ + tests/asfloat.shader_test \ tests/asuint.shader_test \ tests/bitwise.shader_test \ tests/bool-semantics.shader_test \ diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 2d08d18b..1ce65e84 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2508,6 +2508,29 @@ static struct hlsl_type *convert_numeric_type(const struct hlsl_ctx *ctx, return hlsl_get_numeric_type(ctx, type->class, base_type, type->dimx, type->dimy); } +static bool intrinsic_asfloat(struct hlsl_ctx *ctx, + const struct parse_initializer *params, const struct vkd3d_shader_location *loc) +{ + struct hlsl_ir_node *operands[HLSL_MAX_OPERANDS] = {0}; + struct hlsl_type *data_type; + + data_type = params->args[0]->data_type; + if (data_type->base_type == HLSL_TYPE_BOOL || data_type->base_type == HLSL_TYPE_DOUBLE) + { + struct vkd3d_string_buffer *string; + + if ((string = hlsl_type_to_string(ctx, data_type))) + hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE, + "Wrong argument type of asfloat(): expected 'int', 'uint', 'float', or 'half', but got '%s'.", + string->buffer); + hlsl_release_string_buffer(ctx, string); + } + data_type = convert_numeric_type(ctx, data_type, HLSL_TYPE_FLOAT); + + operands[0] = params->args[0]; + return add_expr(ctx, params->instrs, HLSL_OP1_REINTERPRET, operands, data_type, loc); +} + static bool intrinsic_asuint(struct hlsl_ctx *ctx, const struct parse_initializer *params, const struct vkd3d_shader_location *loc) { @@ -3461,6 +3484,7 @@ intrinsic_functions[] = {"abs", 1, true, intrinsic_abs}, {"all", 1, true, intrinsic_all}, {"any", 1, true, intrinsic_any}, + {"asfloat", 1, true, intrinsic_asfloat}, {"asuint", -1, true, intrinsic_asuint}, {"clamp", 3, true, intrinsic_clamp}, {"cos", 1, true, intrinsic_cos}, diff --git a/tests/asfloat.shader_test b/tests/asfloat.shader_test new file mode 100644 index 00000000..9c0d9373 --- /dev/null +++ b/tests/asfloat.shader_test @@ -0,0 +1,48 @@ +[require] +shader model >= 4.0 + +[pixel shader] +float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv_target +{ + float4 ret; + + ret.x = asfloat(f); + ret.y = asfloat(i); + ret.z = asfloat(u); + ret.w = asfloat(h); + return ret; +} + +[test] +uniform 0 float4 123.0 -2.0 456 0.01 +draw quad +probe (320,240) rgba (123.0, -2.0, 456.0, 0.01) + +[pixel shader] +float4 main(uniform float2x2 m, uniform float4 v) : sv_target +{ + return float4(asfloat(m)[0][1], asfloat(v).y, 0, 0); +} + +[test] +uniform 0 float4 11 12 0 0 +uniform 4 float4 13 14 0 0 +uniform 8 float4 20 21 22 23 +draw quad +probe (320,240) rgba (13.0, 21.0, 0.0, 0.0) + +[pixel shader fail] +float4 main() : sv_target +{ + bool b = true; + + return asfloat(b); +} + +[pixel shader fail] +float4 main() : sv_target +{ + double d = 1.0; + + return asfloat(d); +}
1
0
0
0
Nikolay Sivov : tests: Fix a typo in asuint() test shader.
by Alexandre Julliard
02 May '23
02 May '23
Module: vkd3d Branch: master Commit: 3f90a0e67199280bdea242184f151555138f583c URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/3f90a0e67199280bdea242184f151…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Apr 30 01:49:44 2023 +0200 tests: Fix a typo in asuint() test shader. --- tests/asuint.shader_test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/asuint.shader_test b/tests/asuint.shader_test index a08beaf3..633a543a 100644 --- a/tests/asuint.shader_test +++ b/tests/asuint.shader_test @@ -51,5 +51,5 @@ float4 main() : sv_target { double d = 1.0; - return asuint(b); + return asuint(d); }
1
0
0
0
Nikolay Sivov : vkd3d-shader/hlsl: Partially implement static expressions evaluation.
by Alexandre Julliard
02 May '23
02 May '23
Module: vkd3d Branch: master Commit: 7d41cf44402d016ae456d45376ee3ead6872ae6f URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/7d41cf44402d016ae456d45376ee3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Apr 25 15:04:29 2023 +0200 vkd3d-shader/hlsl: Partially implement static expressions evaluation. --- Makefile.am | 1 + libs/vkd3d-shader/hlsl.h | 2 + libs/vkd3d-shader/hlsl.y | 86 ++++++++++++++++------------------ libs/vkd3d-shader/hlsl_codegen.c | 68 +++++++++++++-------------- tests/hlsl-array-size-expr.shader_test | 40 ++++++++++++++++ tests/hlsl-invalid.shader_test | 2 +- 6 files changed, 118 insertions(+), 81 deletions(-)
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_resource_store().
by Alexandre Julliard
02 May '23
02 May '23
Module: vkd3d Branch: master Commit: 6de904b4488d1e2f8ac2a21e7481efba7c8c2e9a URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/6de904b4488d1e2f8ac2a21e7481e…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Nov 10 20:39:11 2022 -0600 vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_resource_store(). --- libs/vkd3d-shader/hlsl.c | 4 ++-- libs/vkd3d-shader/hlsl.h | 2 +- libs/vkd3d-shader/hlsl.y | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 1ef38495..51da0510 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -1330,7 +1330,7 @@ struct hlsl_ir_node *hlsl_new_resource_load(struct hlsl_ctx *ctx, return &load->node; } -struct hlsl_ir_resource_store *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource, +struct hlsl_ir_node *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource, struct hlsl_ir_node *coords, struct hlsl_ir_node *value, const struct vkd3d_shader_location *loc) { struct hlsl_ir_resource_store *store; @@ -1341,7 +1341,7 @@ struct hlsl_ir_resource_store *hlsl_new_resource_store(struct hlsl_ctx *ctx, con hlsl_copy_deref(ctx, &store->resource, resource); hlsl_src_from_node(&store->coords, coords); hlsl_src_from_node(&store->value, value); - return store; + return &store->node; } struct hlsl_ir_swizzle *hlsl_new_swizzle(struct hlsl_ctx *ctx, DWORD s, unsigned int components, diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 835a4192..1caf3c1e 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -1113,7 +1113,7 @@ struct hlsl_ir_node *hlsl_new_loop(struct hlsl_ctx *ctx, struct hlsl_block *block, const struct vkd3d_shader_location *loc); struct hlsl_ir_node *hlsl_new_resource_load(struct hlsl_ctx *ctx, const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc); -struct hlsl_ir_resource_store *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource, +struct hlsl_ir_node *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource, struct hlsl_ir_node *coords, struct hlsl_ir_node *value, const struct vkd3d_shader_location *loc); struct hlsl_type *hlsl_new_struct_type(struct hlsl_ctx *ctx, const char *name, struct hlsl_struct_field *fields, size_t field_count); diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 99de0f22..13236ae8 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -1778,9 +1778,9 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in if (lhs->type == HLSL_IR_RESOURCE_LOAD) { struct hlsl_ir_resource_load *load = hlsl_ir_resource_load(lhs); - struct hlsl_ir_resource_store *store; struct hlsl_type *resource_type; struct hlsl_ir_swizzle *coords; + struct hlsl_ir_node *store; unsigned int dim_count; /* Such an lvalue was produced by an index expression. */ @@ -1809,7 +1809,7 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct list *in if (!(store = hlsl_new_resource_store(ctx, &load->resource, &coords->node, rhs, &lhs->loc))) return NULL; - list_add_tail(instrs, &store->node.entry); + list_add_tail(instrs, &store->entry); } else if (lhs->type == HLSL_IR_INDEX && hlsl_index_is_noncontiguous(hlsl_ir_index(lhs))) {
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_resource_load().
by Alexandre Julliard
02 May '23
02 May '23
Module: vkd3d Branch: master Commit: 3cc18f1e9f50474fdd99f01e191c1bc92a1de713 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/3cc18f1e9f50474fdd99f01e191c1…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Nov 10 20:38:31 2022 -0600 vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_resource_load(). --- libs/vkd3d-shader/hlsl.c | 4 ++-- libs/vkd3d-shader/hlsl.h | 2 +- libs/vkd3d-shader/hlsl.y | 25 ++++++++++++------------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index ab41849e..1ef38495 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -1298,7 +1298,7 @@ struct hlsl_ir_node *hlsl_new_load_component(struct hlsl_ctx *ctx, struct hlsl_b return &load->node; } -struct hlsl_ir_resource_load *hlsl_new_resource_load(struct hlsl_ctx *ctx, +struct hlsl_ir_node *hlsl_new_resource_load(struct hlsl_ctx *ctx, const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc) { struct hlsl_ir_resource_load *load; @@ -1327,7 +1327,7 @@ struct hlsl_ir_resource_load *hlsl_new_resource_load(struct hlsl_ctx *ctx, hlsl_src_from_node(&load->coords, params->coords); hlsl_src_from_node(&load->texel_offset, params->texel_offset); hlsl_src_from_node(&load->lod, params->lod); - return load; + return &load->node; } struct hlsl_ir_resource_store *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource, diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index a18d49c6..835a4192 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -1111,7 +1111,7 @@ struct hlsl_ir_node *hlsl_new_index(struct hlsl_ctx *ctx, struct hlsl_ir_node *v struct hlsl_ir_node *idx, const struct vkd3d_shader_location *loc); struct hlsl_ir_node *hlsl_new_loop(struct hlsl_ctx *ctx, struct hlsl_block *block, const struct vkd3d_shader_location *loc); -struct hlsl_ir_resource_load *hlsl_new_resource_load(struct hlsl_ctx *ctx, +struct hlsl_ir_node *hlsl_new_resource_load(struct hlsl_ctx *ctx, const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc); struct hlsl_ir_resource_store *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource, struct hlsl_ir_node *coords, struct hlsl_ir_node *value, const struct vkd3d_shader_location *loc); diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 635b6fab..99de0f22 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -757,7 +757,7 @@ static bool add_array_access(struct hlsl_ctx *ctx, struct list *instrs, struct h { struct hlsl_resource_load_params load_params = {.type = HLSL_RESOURCE_LOAD}; unsigned int dim_count = hlsl_sampler_dim_count(expr_type->sampler_dim); - struct hlsl_ir_resource_load *resource_load; + struct hlsl_ir_node *resource_load; if (index_type->class > HLSL_CLASS_VECTOR || index_type->dimx != dim_count) { @@ -783,7 +783,7 @@ static bool add_array_access(struct hlsl_ctx *ctx, struct list *instrs, struct h if (!(resource_load = hlsl_new_resource_load(ctx, &load_params, loc))) return false; - list_add_tail(instrs, &resource_load->node.entry); + list_add_tail(instrs, &resource_load->entry); return true; } @@ -3300,8 +3300,7 @@ static bool intrinsic_tex(struct hlsl_ctx *ctx, const struct parse_initializer * { struct hlsl_resource_load_params load_params = {.type = HLSL_RESOURCE_SAMPLE}; const struct hlsl_type *sampler_type; - struct hlsl_ir_resource_load *load; - struct hlsl_ir_node *coords; + struct hlsl_ir_node *coords, *load; if (params->args_count != 2 && params->args_count != 4) { @@ -3338,7 +3337,7 @@ static bool intrinsic_tex(struct hlsl_ctx *ctx, const struct parse_initializer * if (!(load = hlsl_new_resource_load(ctx, &load_params, loc))) return false; - list_add_tail(params->instrs, &load->node.entry); + list_add_tail(params->instrs, &load->entry); return true; } @@ -3731,7 +3730,7 @@ static bool add_load_method_call(struct hlsl_ctx *ctx, struct list *instrs, stru const unsigned int sampler_dim = hlsl_sampler_dim_count(object_type->sampler_dim); const unsigned int offset_dim = hlsl_offset_dim_count(object_type->sampler_dim); struct hlsl_resource_load_params load_params = {.type = HLSL_RESOURCE_LOAD}; - struct hlsl_ir_resource_load *load; + struct hlsl_ir_node *load; bool multisampled; multisampled = object_type->sampler_dim == HLSL_SAMPLER_DIM_2DMS @@ -3771,7 +3770,7 @@ static bool add_load_method_call(struct hlsl_ctx *ctx, struct list *instrs, stru if (!(load = hlsl_new_resource_load(ctx, &load_params, loc))) return false; - list_add_tail(instrs, &load->node.entry); + list_add_tail(instrs, &load->entry); return true; } @@ -3783,7 +3782,7 @@ static bool add_sample_method_call(struct hlsl_ctx *ctx, struct list *instrs, st const unsigned int offset_dim = hlsl_offset_dim_count(object_type->sampler_dim); struct hlsl_resource_load_params load_params = {.type = HLSL_RESOURCE_SAMPLE}; const struct hlsl_type *sampler_type; - struct hlsl_ir_resource_load *load; + struct hlsl_ir_node *load; if (params->args_count < 2 || params->args_count > 4 + !!offset_dim) { @@ -3828,7 +3827,7 @@ static bool add_sample_method_call(struct hlsl_ctx *ctx, struct list *instrs, st if (!(load = hlsl_new_resource_load(ctx, &load_params, loc))) return false; - list_add_tail(instrs, &load->node.entry); + list_add_tail(instrs, &load->entry); return true; } @@ -3841,7 +3840,7 @@ static bool add_gather_method_call(struct hlsl_ctx *ctx, struct list *instrs, st const unsigned int offset_dim = hlsl_offset_dim_count(object_type->sampler_dim); struct hlsl_resource_load_params load_params = {0}; const struct hlsl_type *sampler_type; - struct hlsl_ir_resource_load *load; + struct hlsl_ir_node *load; unsigned int read_channel; if (!strcmp(name, "GatherGreen")) @@ -3927,7 +3926,7 @@ static bool add_gather_method_call(struct hlsl_ctx *ctx, struct list *instrs, st if (!(load = hlsl_new_resource_load(ctx, &load_params, loc))) return false; - list_add_tail(instrs, &load->node.entry); + list_add_tail(instrs, &load->entry); return true; } @@ -3939,7 +3938,7 @@ static bool add_sample_lod_method_call(struct hlsl_ctx *ctx, struct list *instrs const unsigned int sampler_dim = hlsl_sampler_dim_count(object_type->sampler_dim); const unsigned int offset_dim = hlsl_offset_dim_count(object_type->sampler_dim); const struct hlsl_type *sampler_type; - struct hlsl_ir_resource_load *load; + struct hlsl_ir_node *load; if (!strcmp(name, "SampleLevel")) load_params.type = HLSL_RESOURCE_SAMPLE_LOD; @@ -3991,7 +3990,7 @@ static bool add_sample_lod_method_call(struct hlsl_ctx *ctx, struct list *instrs if (!(load = hlsl_new_resource_load(ctx, &load_params, loc))) return false; - list_add_tail(instrs, &load->node.entry); + list_add_tail(instrs, &load->entry); return true; }
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_loop().
by Alexandre Julliard
02 May '23
02 May '23
Module: vkd3d Branch: master Commit: 8485b2ee95ac6d5c8101c2d559e96e11c07691e9 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/8485b2ee95ac6d5c8101c2d559e96…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Nov 10 20:36:14 2022 -0600 vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_loop(). --- libs/vkd3d-shader/hlsl.c | 8 ++++---- libs/vkd3d-shader/hlsl.h | 2 +- libs/vkd3d-shader/hlsl.y | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 71bf0daa..ab41849e 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -1403,7 +1403,7 @@ struct hlsl_ir_node *hlsl_new_jump(struct hlsl_ctx *ctx, enum hlsl_ir_jump_type return &jump->node; } -struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, +struct hlsl_ir_node *hlsl_new_loop(struct hlsl_ctx *ctx, struct hlsl_block *block, const struct vkd3d_shader_location *loc) { struct hlsl_ir_loop *loop; @@ -1413,7 +1413,7 @@ struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, init_node(&loop->node, HLSL_IR_LOOP, NULL, loc); hlsl_block_init(&loop->body); hlsl_block_add_block(&loop->body, block); - return loop; + return &loop->node; } struct clone_instr_map @@ -1573,7 +1573,7 @@ static struct hlsl_ir_node *clone_load(struct hlsl_ctx *ctx, struct clone_instr_ static struct hlsl_ir_node *clone_loop(struct hlsl_ctx *ctx, struct clone_instr_map *map, struct hlsl_ir_loop *src) { - struct hlsl_ir_loop *dst; + struct hlsl_ir_node *dst; struct hlsl_block body; if (!clone_block(ctx, &body, &src->body, map)) @@ -1584,7 +1584,7 @@ static struct hlsl_ir_node *clone_loop(struct hlsl_ctx *ctx, struct clone_instr_ hlsl_block_cleanup(&body); return NULL; } - return &dst->node; + return dst; } static struct hlsl_ir_node *clone_resource_load(struct hlsl_ctx *ctx, diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 68e3850c..a18d49c6 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -1109,7 +1109,7 @@ bool hlsl_index_is_noncontiguous(struct hlsl_ir_index *index); struct hlsl_ir_node *hlsl_new_index(struct hlsl_ctx *ctx, struct hlsl_ir_node *val, struct hlsl_ir_node *idx, const struct vkd3d_shader_location *loc); -struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, +struct hlsl_ir_node *hlsl_new_loop(struct hlsl_ctx *ctx, struct hlsl_block *block, const struct vkd3d_shader_location *loc); struct hlsl_ir_resource_load *hlsl_new_resource_load(struct hlsl_ctx *ctx, const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc); diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index c2f47b80..635b6fab 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -458,8 +458,8 @@ static bool attribute_list_has_duplicates(const struct parse_attribute_list *att static struct list *create_loop(struct hlsl_ctx *ctx, enum loop_type type, const struct parse_attribute_list *attributes, struct list *init, struct list *cond, struct list *iter, struct list *body, const struct vkd3d_shader_location *loc) { - struct hlsl_ir_loop *loop = NULL; struct hlsl_block body_block; + struct hlsl_ir_node *loop; unsigned int i; if (attribute_list_has_duplicates(attributes)) @@ -513,14 +513,13 @@ static struct list *create_loop(struct hlsl_ctx *ctx, enum loop_type type, const if (!(loop = hlsl_new_loop(ctx, &body_block, loc))) goto oom; - list_add_tail(init, &loop->node.entry); + list_add_tail(init, &loop->entry); vkd3d_free(cond); vkd3d_free(body); return init; oom: - vkd3d_free(loop); destroy_instr_list(init); destroy_instr_list(cond); destroy_instr_list(iter);
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Pass an hlsl_block pointer to hlsl_new_loop().
by Alexandre Julliard
02 May '23
02 May '23
Module: vkd3d Branch: master Commit: 3ca9656e84b41c34a746378f20bd7ec2e512edd1 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/3ca9656e84b41c34a746378f20bd7…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Nov 10 20:35:35 2022 -0600 vkd3d-shader/hlsl: Pass an hlsl_block pointer to hlsl_new_loop(). --- libs/vkd3d-shader/hlsl.c | 12 ++++++++---- libs/vkd3d-shader/hlsl.h | 3 ++- libs/vkd3d-shader/hlsl.y | 19 +++++++++++-------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index fbe555c9..71bf0daa 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -1403,7 +1403,8 @@ struct hlsl_ir_node *hlsl_new_jump(struct hlsl_ctx *ctx, enum hlsl_ir_jump_type return &jump->node; } -struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc) +struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, + struct hlsl_block *block, const struct vkd3d_shader_location *loc) { struct hlsl_ir_loop *loop; @@ -1411,6 +1412,7 @@ struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, const struct vkd3d_shad return NULL; init_node(&loop->node, HLSL_IR_LOOP, NULL, loc); hlsl_block_init(&loop->body); + hlsl_block_add_block(&loop->body, block); return loop; } @@ -1572,12 +1574,14 @@ static struct hlsl_ir_node *clone_load(struct hlsl_ctx *ctx, struct clone_instr_ static struct hlsl_ir_node *clone_loop(struct hlsl_ctx *ctx, struct clone_instr_map *map, struct hlsl_ir_loop *src) { struct hlsl_ir_loop *dst; + struct hlsl_block body; - if (!(dst = hlsl_new_loop(ctx, &src->node.loc))) + if (!clone_block(ctx, &body, &src->body, map)) return NULL; - if (!clone_block(ctx, &dst->body, &src->body, map)) + + if (!(dst = hlsl_new_loop(ctx, &body, &src->node.loc))) { - hlsl_free_instr(&dst->node); + hlsl_block_cleanup(&body); return NULL; } return &dst->node; diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 0256339c..68e3850c 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -1109,7 +1109,8 @@ bool hlsl_index_is_noncontiguous(struct hlsl_ir_index *index); struct hlsl_ir_node *hlsl_new_index(struct hlsl_ctx *ctx, struct hlsl_ir_node *val, struct hlsl_ir_node *idx, const struct vkd3d_shader_location *loc); -struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc); +struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, + struct hlsl_block *block, const struct vkd3d_shader_location *loc); struct hlsl_ir_resource_load *hlsl_new_resource_load(struct hlsl_ctx *ctx, const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc); struct hlsl_ir_resource_store *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource, diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 598f21f3..c2f47b80 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -459,6 +459,7 @@ static struct list *create_loop(struct hlsl_ctx *ctx, enum loop_type type, const struct list *iter, struct list *body, const struct vkd3d_shader_location *loc) { struct hlsl_ir_loop *loop = NULL; + struct hlsl_block body_block; unsigned int i; if (attribute_list_has_duplicates(attributes)) @@ -494,23 +495,25 @@ static struct list *create_loop(struct hlsl_ctx *ctx, enum loop_type type, const if (!init && !(init = make_empty_list(ctx))) goto oom; - if (!(loop = hlsl_new_loop(ctx, loc))) - goto oom; - list_add_tail(init, &loop->node.entry); - if (!append_conditional_break(ctx, cond)) goto oom; + hlsl_block_init(&body_block); + if (type != LOOP_DO_WHILE) - list_move_tail(&loop->body.instrs, cond); + list_move_tail(&body_block.instrs, cond); - list_move_tail(&loop->body.instrs, body); + list_move_tail(&body_block.instrs, body); if (iter) - list_move_tail(&loop->body.instrs, iter); + list_move_tail(&body_block.instrs, iter); if (type == LOOP_DO_WHILE) - list_move_tail(&loop->body.instrs, cond); + list_move_tail(&body_block.instrs, cond); + + if (!(loop = hlsl_new_loop(ctx, &body_block, loc))) + goto oom; + list_add_tail(init, &loop->node.entry); vkd3d_free(cond); vkd3d_free(body);
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Reuse the "init" instruction list if possible in create_loop().
by Alexandre Julliard
02 May '23
02 May '23
Module: vkd3d Branch: master Commit: e848c57b4658a17022031d3db17427d10a7a6684 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/e848c57b4658a17022031d3db1742…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Nov 14 19:29:46 2022 -0600 vkd3d-shader/hlsl: Reuse the "init" instruction list if possible in create_loop(). --- libs/vkd3d-shader/hlsl.y | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index ab0b3f65..598f21f3 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -458,7 +458,6 @@ static bool attribute_list_has_duplicates(const struct parse_attribute_list *att static struct list *create_loop(struct hlsl_ctx *ctx, enum loop_type type, const struct parse_attribute_list *attributes, struct list *init, struct list *cond, struct list *iter, struct list *body, const struct vkd3d_shader_location *loc) { - struct list *list = NULL; struct hlsl_ir_loop *loop = NULL; unsigned int i; @@ -492,15 +491,12 @@ static struct list *create_loop(struct hlsl_ctx *ctx, enum loop_type type, const } } - if (!(list = make_empty_list(ctx))) + if (!init && !(init = make_empty_list(ctx))) goto oom; - if (init) - list_move_head(list, init); - if (!(loop = hlsl_new_loop(ctx, loc))) goto oom; - list_add_tail(list, &loop->node.entry); + list_add_tail(init, &loop->node.entry); if (!append_conditional_break(ctx, cond)) goto oom; @@ -516,14 +512,12 @@ static struct list *create_loop(struct hlsl_ctx *ctx, enum loop_type type, const if (type == LOOP_DO_WHILE) list_move_tail(&loop->body.instrs, cond); - vkd3d_free(init); vkd3d_free(cond); vkd3d_free(body); - return list; + return init; oom: vkd3d_free(loop); - vkd3d_free(list); destroy_instr_list(init); destroy_instr_list(cond); destroy_instr_list(iter);
1
0
0
0
Henri Verbeet : vkd3d-shader/d3d-asm: Rename trace.c to d3d_asm.c.
by Alexandre Julliard
02 May '23
02 May '23
Module: vkd3d Branch: master Commit: 3f8aa0e272b5ac03194074f6734c4868f17d61ac URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/3f8aa0e272b5ac03194074f6734c4…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Apr 20 12:48:20 2023 +0200 vkd3d-shader/d3d-asm: Rename trace.c to d3d_asm.c. --- Makefile.am | 2 +- libs/vkd3d-shader/{trace.c => d3d_asm.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index e3d52ac5..c0311d57 100644 --- a/Makefile.am +++ b/Makefile.am @@ -255,6 +255,7 @@ libvkd3d_shader_la_SOURCES = \ include/private/vkd3d_memory.h \ include/vkd3d_shader.h \ libs/vkd3d-shader/checksum.c \ + libs/vkd3d-shader/d3d_asm.c \ libs/vkd3d-shader/d3dbc.c \ libs/vkd3d-shader/dxbc.c \ libs/vkd3d-shader/glsl.c \ @@ -266,7 +267,6 @@ libvkd3d_shader_la_SOURCES = \ libs/vkd3d-shader/preproc.h \ libs/vkd3d-shader/spirv.c \ libs/vkd3d-shader/tpf.c \ - libs/vkd3d-shader/trace.c \ libs/vkd3d-shader/vkd3d_shader.map \ libs/vkd3d-shader/vkd3d_shader_main.c \ libs/vkd3d-shader/vkd3d_shader_private.h diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/d3d_asm.c similarity index 100% rename from libs/vkd3d-shader/trace.c rename to libs/vkd3d-shader/d3d_asm.c
1
0
0
0
Torge Matthies : ntdll: Set xattr in NtCreateFile if inferred and requested attributes don't match.
by Alexandre Julliard
02 May '23
02 May '23
Module: wine Branch: master Commit: 824547805559ee4993b8113436161638f3cd7990 URL:
https://gitlab.winehq.org/wine/wine/-/commit/824547805559ee4993b81134361616…
Author: Torge Matthies <tmatthies(a)codeweavers.com> Date: Wed Apr 12 13:35:10 2023 +0200 ntdll: Set xattr in NtCreateFile if inferred and requested attributes don't match. And make sure it doesn't get deleted. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53826
Signed-off-by: Torge Matthies <tmatthies(a)codeweavers.com> --- dlls/ntdll/tests/file.c | 2 +- dlls/ntdll/unix/file.c | 28 ++++++++++++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index cdd924a7226..b96b2e5b072 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -4094,7 +4094,7 @@ static void test_dotfile_file_attributes(void) status = nt_get_file_attrs(filename, &attrs); ok( status == STATUS_SUCCESS, "got %#lx\n", status ); - todo_wine ok( !(attrs & FILE_ATTRIBUTE_HIDDEN), "got attributes %#lx\n", attrs ); + ok( !(attrs & FILE_ATTRIBUTE_HIDDEN), "got attributes %#lx\n", attrs ); status = pNtQueryInformationFile( h, &io, &info, sizeof(info), FileBasicInformation ); ok( status == STATUS_SUCCESS, "got %#lx\n", status ); diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index cb269a0e126..0263d53716b 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1604,11 +1604,11 @@ static int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULON } -static int fd_set_dos_attrib( int fd, UINT attr ) +static int fd_set_dos_attrib( int fd, UINT attr, BOOL force_set ) { /* we only store the HIDDEN and SYSTEM attributes */ attr &= XATTR_ATTRIBS_MASK; - if (attr != 0) + if (force_set || attr != 0) { /* encode the attributes in Samba 3 ASCII format. Samba 4 has extended * this format with more features, but retains compatibility with the @@ -1622,7 +1622,7 @@ static int fd_set_dos_attrib( int fd, UINT attr ) /* set the stat info and file attributes for a file (by file descriptor) */ -static NTSTATUS fd_set_file_info( int fd, UINT attr ) +static NTSTATUS fd_set_file_info( int fd, UINT attr, BOOL force_set_xattr ) { struct stat st; @@ -1641,7 +1641,11 @@ static NTSTATUS fd_set_file_info( int fd, UINT attr ) } if (fchmod( fd, st.st_mode ) == -1) return errno_to_status( errno ); - if (fd_set_dos_attrib( fd, attr ) == -1 && errno != ENOTSUP) + /* if the file has multiple names, we can't be sure that it is safe to not + set the extended attribute, since any of the names could start with a dot */ + force_set_xattr = force_set_xattr || st.st_nlink > 1; + + if (fd_set_dos_attrib( fd, attr, force_set_xattr ) == -1 && errno != ENOTSUP) WARN( "Failed to set extended attribute " SAMBA_XATTR_DOS_ATTRIB ". errno %d (%s)\n", errno, strerror( errno ) ); @@ -3967,6 +3971,7 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU OBJECT_ATTRIBUTES new_attr; UNICODE_STRING nt_name; char *unix_name; + BOOL name_hidden = FALSE; BOOL created = FALSE; unsigned int status; @@ -4009,6 +4014,7 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU if (status == STATUS_SUCCESS) { + name_hidden = is_hidden_file( unix_name ); status = open_unix_file( handle, unix_name, access, &new_attr, attributes, sharing, disposition, options, ea_buffer, ea_length ); free( unix_name ); @@ -4036,14 +4042,15 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU break; } - if (io->Information == FILE_CREATED && (attributes & XATTR_ATTRIBS_MASK)) + if (io->Information == FILE_CREATED && + ((attributes & XATTR_ATTRIBS_MASK) || name_hidden)) { int fd, needs_close; /* set any DOS extended attributes */ if (!server_get_unix_fd( *handle, 0, &fd, &needs_close, NULL, NULL )) { - if (fd_set_dos_attrib( fd, attributes ) == -1 && errno != ENOTSUP) + if (fd_set_dos_attrib( fd, attributes, TRUE ) == -1 && errno != ENOTSUP) WARN( "Failed to set extended attribute " SAMBA_XATTR_DOS_ATTRIB ". errno %d (%s)", errno, strerror( errno ) ); if (needs_close) close( fd ); @@ -4565,20 +4572,25 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io, { const FILE_BASIC_INFORMATION *info = ptr; LARGE_INTEGER mtime, atime; + char *unix_name; if ((status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL ))) return io->u.Status = status; + if (server_get_unix_name( handle, &unix_name )) unix_name = NULL; + mtime.QuadPart = info->LastWriteTime.QuadPart == -1 ? 0 : info->LastWriteTime.QuadPart; atime.QuadPart = info->LastAccessTime.QuadPart == -1 ? 0 : info->LastAccessTime.QuadPart; if (atime.QuadPart || mtime.QuadPart) status = set_file_times( fd, &mtime, &atime ); - if (status == STATUS_SUCCESS && info->FileAttributes) - status = fd_set_file_info( fd, info->FileAttributes ); + if (status == STATUS_SUCCESS) + status = fd_set_file_info( fd, info->FileAttributes, + unix_name && is_hidden_file( unix_name )); if (needs_close) close( fd ); + free( unix_name ); } else status = STATUS_INVALID_PARAMETER_3; break;
1
0
0
0
← Newer
1
...
70
71
72
73
74
75
76
77
78
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
Results per page:
10
25
50
100
200