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
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
July 2024
----- 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
2 participants
519 discussions
Start a n
N
ew thread
Giovanni Mascellani : vkd3d: Do not synchronize with the tessellation shader stages if they're not enabled.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: vkd3d Branch: master Commit: 7958babb39ccd53efc7c67edc0e9a3d1c860f8f4 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/7958babb39ccd53efc7c67edc0e9a…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Sat Jun 1 21:50:31 2024 +0200 vkd3d: Do not synchronize with the tessellation shader stages if they're not enabled. Similarly to a54187f3c9c9ad4a5d1357721104f28c498ac112, this fixes some validation errors on devices that do not support tessellation; the Adreno 540 on my OnePlus 5 phone in my specific case. --- libs/vkd3d/command.c | 5 +++-- libs/vkd3d/device.c | 1 + libs/vkd3d/vkd3d_private.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 6c463be8..2354938c 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -2034,11 +2034,12 @@ static bool vk_barrier_parameters_from_d3d12_resource_state(unsigned int state, if (vk_queue_flags & VK_QUEUE_GRAPHICS_BIT) { queue_shader_stages |= VK_PIPELINE_STAGE_VERTEX_SHADER_BIT - | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT - | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT; if (device->vk_info.geometry_shaders) queue_shader_stages |= VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT; + if (device->vk_info.tessellation_shaders) + queue_shader_stages |= VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT + | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT; } if (vk_queue_flags & VK_QUEUE_COMPUTE_BIT) queue_shader_stages |= VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT; diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 674e46fe..2bbc1705 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1644,6 +1644,7 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device, vulkan_info->device_limits = physical_device_info->properties2.properties.limits; vulkan_info->sparse_properties = physical_device_info->properties2.properties.sparseProperties; vulkan_info->geometry_shaders = physical_device_info->features2.features.geometryShader; + vulkan_info->tessellation_shaders = physical_device_info->features2.features.tessellationShader; vulkan_info->sparse_binding = features->sparseBinding; vulkan_info->sparse_residency_3d = features->sparseResidencyImage3D; vulkan_info->rasterization_stream = physical_device_info->xfb_properties.transformFeedbackRasterizationStreamSelect; diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 226b71fe..733163e3 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -147,6 +147,7 @@ struct vkd3d_vulkan_info bool rasterization_stream; bool transform_feedback_queries; bool geometry_shaders; + bool tessellation_shaders; bool uav_read_without_format;
1
0
0
0
Giovanni Mascellani : tests: Check that depth/stencil formats are supported before using them.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: vkd3d Branch: master Commit: 3ff813056607dea82859a48e49962858733fecc4 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/3ff813056607dea82859a48e49962…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Sat Jun 1 21:39:04 2024 +0200 tests: Check that depth/stencil formats are supported before using them. This fixes a crash with the Qualcomm proprietary driver on an Adreno 540 GPU on my OnePlus 5 phone. --- tests/d3d12.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/tests/d3d12.c b/tests/d3d12.c index c18dbb80..31f387db 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -547,6 +547,19 @@ static bool is_typed_uav_format_supported(ID3D12Device *device, DXGI_FORMAT form return format_support.Support1 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW; } +static bool is_ds_format_supported(ID3D12Device *device, DXGI_FORMAT format) +{ + D3D12_FEATURE_DATA_FORMAT_SUPPORT format_support = {0}; + HRESULT hr; + + format_support.Format = format; + hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_FORMAT_SUPPORT, + &format_support, sizeof(format_support)); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + return format_support.Support1 & D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL; +} + static bool are_unaligned_block_textures_supported(ID3D12Device *device) { D3D12_FEATURE_DATA_D3D12_OPTIONS8 options; @@ -21021,11 +21034,12 @@ static void test_depth_stencil_sampling(void) DXGI_FORMAT depth_view_format; DXGI_FORMAT stencil_view_format; bool is_mvk_bug; + bool is_qualcomm_todo; } tests[] = { {DXGI_FORMAT_R32G8X24_TYPELESS, DXGI_FORMAT_D32_FLOAT_S8X24_UINT, - DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS, DXGI_FORMAT_X32_TYPELESS_G8X24_UINT}, + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS, DXGI_FORMAT_X32_TYPELESS_G8X24_UINT, false, true}, {DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_R32_FLOAT}, {DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, @@ -21117,8 +21131,19 @@ static void test_depth_stencil_sampling(void) for (i = 0; i < ARRAY_SIZE(tests); ++i) { + bool supported = is_ds_format_supported(device, tests[i].dsv_format); + vkd3d_test_push_context("Test %u", i); + todo_if(tests[i].is_qualcomm_todo && is_qualcomm_device(device)) + ok(supported, "Depth/stencil format %#x is not supported.\n", tests[i].dsv_format); + + if (!supported) + { + vkd3d_test_pop_context(); + continue; + } + reset_command_list(command_list, context.allocator); init_depth_stencil(&ds, device, context.render_target_desc.Width,
1
0
0
0
Giovanni Mascellani : tests: Transition resources to PIXEL_SHADER_RESOURCE in test_sample_c_lz().
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: vkd3d Branch: master Commit: 9f056f398963c24530034235317a51fbdf242822 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/9f056f398963c24530034235317a5…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Sat Jun 1 21:38:59 2024 +0200 tests: Transition resources to PIXEL_SHADER_RESOURCE in test_sample_c_lz(). --- tests/d3d12.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/d3d12.c b/tests/d3d12.c index 79444f1d..c18dbb80 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -15506,6 +15506,8 @@ static void test_sample_c_lz(void) transition_resource_state(command_list, ds.texture, D3D12_RESOURCE_STATE_DEPTH_WRITE, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); + transition_resource_state(command_list, ds_offset.texture, + D3D12_RESOURCE_STATE_DEPTH_WRITE, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); memset(&ps_constant, 0, sizeof(ps_constant)); for (j = 0; j < ARRAY_SIZE(shaders_2d_array); ++j)
1
0
0
0
Giovanni Mascellani : tests: Skip sampling cube textures on Qualcomm.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: vkd3d Branch: master Commit: fe787cf77f8732aad136fc67802d9d113ca69876 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/fe787cf77f8732aad136fc67802d9…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Sat Jun 1 21:38:52 2024 +0200 tests: Skip sampling cube textures on Qualcomm. They seem to always crash on the Adreno 540 on my OnePlus 5 phone with the Qualcomm proprietary driver. --- tests/d3d12.c | 6 ++++++ tests/d3d12_crosstest.h | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/tests/d3d12.c b/tests/d3d12.c index fcdf844d..79444f1d 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -15616,6 +15616,12 @@ static void test_sample_c_lz(void) for (i = 0; i < ARRAY_SIZE(tests); ++i) { + if (is_qualcomm_device(device)) + { + skip("Sampling a cube texture crashes on Qualcomm.\n"); + break; + } + vkd3d_test_push_context("test %u", i); ps_constant.x = tests[i].d_ref; diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index 99641425..c24623ca 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -417,6 +417,11 @@ static inline bool is_nvidia_device(ID3D12Device *device) return false; } +static inline bool is_qualcomm_device(ID3D12Device *device) +{ + return false; +} + static inline bool is_radv_device(ID3D12Device *device) { return false; @@ -709,6 +714,14 @@ static inline bool is_nvidia_device(ID3D12Device *device) return properties.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR; } +static inline bool is_qualcomm_device(ID3D12Device *device) +{ + VkPhysicalDeviceDriverPropertiesKHR properties; + + get_driver_properties(device, NULL, &properties); + return properties.driverID == VK_DRIVER_ID_QUALCOMM_PROPRIETARY_KHR; +} + static inline bool is_radv_device(ID3D12Device *device) { VkPhysicalDeviceDriverPropertiesKHR properties;
1
0
0
0
Nikolay Sivov : vkd3d-shader/fx: Write annotations for fx_4+ profiles.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: vkd3d Branch: master Commit: 937a80ead66ce57698205f8b7d195aec85d7e527 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/937a80ead66ce57698205f8b7d195…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jun 15 23:44:08 2024 +0200 vkd3d-shader/fx: Write annotations for fx_4+ profiles. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- libs/vkd3d-shader/fx.c | 81 +++++++++++++++++++++++++++++++------- tests/hlsl/annotations.shader_test | 2 +- 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index 9acb1f79..75f10a18 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -63,6 +63,7 @@ struct fx_write_context_ops uint32_t (*write_string)(const char *string, struct fx_write_context *fx); void (*write_technique)(struct hlsl_ir_var *var, struct fx_write_context *fx); void (*write_pass)(struct hlsl_ir_var *var, struct fx_write_context *fx); + void (*write_annotation)(struct hlsl_ir_var *var, struct fx_write_context *fx); bool are_child_effects_supported; }; @@ -130,8 +131,41 @@ static void write_pass(struct hlsl_ir_var *var, struct fx_write_context *fx) fx->ops->write_pass(var, fx); } +static uint32_t write_annotations(struct hlsl_scope *scope, struct fx_write_context *fx) +{ + struct hlsl_ctx *ctx = fx->ctx; + struct hlsl_ir_var *v; + uint32_t count = 0; + + if (!scope) + return 0; + + LIST_FOR_EACH_ENTRY(v, &scope->vars, struct hlsl_ir_var, scope_entry) + { + if (!v->default_values) + hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, + "Annotation variable is missing default value."); + + fx->ops->write_annotation(v, fx); + ++count; + } + + return count; +} + +static void write_fx_4_annotations(struct hlsl_scope *scope, struct fx_write_context *fx) +{ + struct vkd3d_bytecode_buffer *buffer = &fx->structured; + uint32_t count_offset, count; + + count_offset = put_u32(buffer, 0); + count = write_annotations(scope, fx); + set_u32(buffer, count_offset, count); +} + static uint32_t write_fx_4_type(const struct hlsl_type *type, struct fx_write_context *fx); static const char * get_fx_4_type_name(const struct hlsl_type *type); +static void write_fx_4_annotation(struct hlsl_ir_var *var, struct fx_write_context *fx); static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context *fx) { @@ -281,9 +315,9 @@ static void write_fx_4_pass(struct hlsl_ir_var *var, struct fx_write_context *fx name_offset = write_string(var->name, fx); put_u32(buffer, name_offset); put_u32(buffer, 0); /* Assignment count. */ - put_u32(buffer, 0); /* Annotation count. */ - /* TODO: annotations */ + write_fx_4_annotations(var->annotations, fx); + /* TODO: assignments */ } @@ -629,8 +663,9 @@ static void write_fx_4_technique(struct hlsl_ir_var *var, struct fx_write_contex name_offset = write_string(var->name, fx); put_u32(buffer, name_offset); count_offset = put_u32(buffer, 0); - put_u32(buffer, 0); /* Annotation count. */ + write_fx_4_annotations(var->annotations, fx); + count = 0; LIST_FOR_EACH_ENTRY(pass, &var->scope->vars, struct hlsl_ir_var, scope_entry) { write_pass(pass, fx); @@ -665,7 +700,7 @@ static void write_group(struct hlsl_ir_var *var, struct fx_write_context *fx) put_u32(buffer, name_offset); count_offset = put_u32(buffer, 0); /* Technique count */ - put_u32(buffer, 0); /* Annotation count */ + write_fx_4_annotations(var ? var->annotations : NULL, fx); count = fx->technique_count; write_techniques(var ? var->scope : fx->ctx->globals, fx); @@ -1026,6 +1061,7 @@ static const struct fx_write_context_ops fx_4_ops = .write_string = write_fx_4_string, .write_technique = write_fx_4_technique, .write_pass = write_fx_4_pass, + .write_annotation = write_fx_4_annotation, .are_child_effects_supported = true, }; @@ -1100,7 +1136,6 @@ static void write_fx_4_numeric_variable(struct hlsl_ir_var *var, bool shared, st { HAS_EXPLICIT_BIND_POINT = 0x4, }; - struct hlsl_ctx *ctx = fx->ctx; if (var->has_explicit_bind_point) flags |= HAS_EXPLICIT_BIND_POINT; @@ -1126,14 +1161,36 @@ static void write_fx_4_numeric_variable(struct hlsl_ir_var *var, bool shared, st uint32_t offset = write_fx_4_default_value(var->data_type, var->default_values, fx); set_u32(buffer, value_offset, offset); - put_u32(buffer, 0); /* Annotations count */ - if (has_annotations(var)) - hlsl_fixme(ctx, &ctx->location, "Writing annotations for numeric variables is not implemented."); + write_fx_4_annotations(var->annotations, fx); fx->numeric_variable_count++; } } +static void write_fx_4_annotation(struct hlsl_ir_var *var, struct fx_write_context *fx) +{ + const struct hlsl_type *type = hlsl_get_multiarray_element_type(var->data_type); + struct vkd3d_bytecode_buffer *buffer = &fx->structured; + uint32_t name_offset, type_offset, offset; + struct hlsl_ctx *ctx = fx->ctx; + + name_offset = write_string(var->name, fx); + type_offset = write_type(var->data_type, fx); + + put_u32(buffer, name_offset); + put_u32(buffer, type_offset); + + if (hlsl_is_numeric_type(type)) + { + offset = write_fx_4_default_value(var->data_type, var->default_values, fx); + put_u32(buffer, offset); + } + else + { + hlsl_fixme(ctx, &var->loc, "Writing annotations for type class %u is not implemented.", type->class); + } +} + struct rhs_named_value { const char *name; @@ -1654,9 +1711,7 @@ static void write_fx_4_object_variable(struct hlsl_ir_var *var, struct fx_write_ type->e.numeric.type); } - put_u32(buffer, 0); /* Annotations count */ - if (has_annotations(var)) - hlsl_fixme(ctx, &ctx->location, "Writing annotations for object variables is not implemented."); + write_fx_4_annotations(var->annotations, fx); ++fx->object_variable_count; } @@ -1699,9 +1754,7 @@ static void write_fx_4_buffer(struct hlsl_buffer *b, struct fx_write_context *fx } else { - put_u32(buffer, 0); /* Annotations count */ - if (b->annotations) - hlsl_fixme(ctx, &b->loc, "Writing annotations for buffers is not implemented."); + write_fx_4_annotations(b->annotations, fx); ++fx->buffer_count; } diff --git a/tests/hlsl/annotations.shader_test b/tests/hlsl/annotations.shader_test index 55a7e65e..3f6739a5 100644 --- a/tests/hlsl/annotations.shader_test +++ b/tests/hlsl/annotations.shader_test @@ -66,7 +66,7 @@ technique10 pass < int a = 0; float a = 1.0; > {} } -[effect fail todo] +[effect fail] // Without initializer technique10 < int a; > {}
1
0
0
0
Nikolay Sivov : vkd3d-shader/hlsl: Set default values for annotations variables.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: vkd3d Branch: master Commit: 0f7ac0a054a11863c58c6167ad467fcb00c31495 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/0f7ac0a054a11863c58c6167ad467…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jun 15 19:56:25 2024 +0200 vkd3d-shader/hlsl: Set default values for annotations variables. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- libs/vkd3d-shader/hlsl.h | 3 +++ libs/vkd3d-shader/hlsl.y | 26 +++++++++++++++++++++++--- tests/hlsl/annotations.shader_test | 6 +++--- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index c31a227c..c7f5ae86 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -388,6 +388,7 @@ struct hlsl_attribute #define HLSL_STORAGE_LINEAR 0x00010000 #define HLSL_MODIFIER_SINGLE 0x00020000 #define HLSL_MODIFIER_EXPORT 0x00040000 +#define HLSL_STORAGE_ANNOTATION 0x00080000 #define HLSL_TYPE_MODIFIERS_MASK (HLSL_MODIFIER_PRECISE | HLSL_MODIFIER_VOLATILE | \ HLSL_MODIFIER_CONST | HLSL_MODIFIER_ROW_MAJOR | \ @@ -841,6 +842,8 @@ struct hlsl_scope bool loop; /* The scope was created for the switch statement. */ bool _switch; + /* The scope contains annotation variables. */ + bool annotations; }; struct hlsl_profile_info diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index c7af2a10..95be7e08 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2625,7 +2625,8 @@ static struct hlsl_block *initialize_vars(struct hlsl_ctx *ctx, struct list *var unsigned int size, k; is_default_values_initializer = (ctx->cur_buffer != ctx->globals_buffer) - || (var->storage_modifiers & HLSL_STORAGE_UNIFORM); + || (var->storage_modifiers & HLSL_STORAGE_UNIFORM) + || ctx->cur_scope->annotations; if (is_default_values_initializer) { @@ -6058,19 +6059,31 @@ pass: annotations_list: variables_def_typed ';' + { + struct hlsl_block *block; + + block = initialize_vars(ctx, $1); + destroy_block(block); + } | annotations_list variables_def_typed ';' + { + struct hlsl_block *block; + + block = initialize_vars(ctx, $2); + destroy_block(block); + } annotations_opt: %empty { $$ = NULL; } - | '<' scope_start '>' + | '<' annotations_scope_start '>' { hlsl_pop_scope(ctx); $$ = NULL; } - | '<' scope_start annotations_list '>' + | '<' annotations_scope_start annotations_list '>' { struct hlsl_scope *scope = ctx->cur_scope; @@ -6598,6 +6611,13 @@ switch_scope_start: ctx->cur_scope->_switch = true; } +annotations_scope_start: + %empty + { + hlsl_push_scope(ctx); + ctx->cur_scope->annotations = true; + } + var_identifier: VAR_IDENTIFIER | NEW_IDENTIFIER diff --git a/tests/hlsl/annotations.shader_test b/tests/hlsl/annotations.shader_test index 4545f7ed..55a7e65e 100644 --- a/tests/hlsl/annotations.shader_test +++ b/tests/hlsl/annotations.shader_test @@ -70,7 +70,7 @@ technique10 // Without initializer technique10 < int a; > {} -[effect fail todo] +[effect fail] // Only numeric types and strings are allowed technique10 < DepthStencilState ds = { 0 }; > {} @@ -82,9 +82,9 @@ technique10 < struct s { int a; } var = { 2 }; > {} // Static modifier is not allowed technique10 < static int a = 5; > {} -[effect fail todo] +[effect fail] // Initializer should not depend on other annotations technique10 < int a = 1, b = a; > {} -[effect fail todo] +[effect fail] technique10 < int a = 1; int b = a; > {}
1
0
0
0
Nikolay Sivov : vkd3d-shader/hlsl: Do not crash on initialization of a redefined variable.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: vkd3d Branch: master Commit: 4d2ce385a7b9d738407c3c59787505c23b2bb0fa URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/4d2ce385a7b9d738407c3c5978750…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jun 15 22:19:40 2024 +0200 vkd3d-shader/hlsl: Do not crash on initialization of a redefined variable. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- libs/vkd3d-shader/hlsl.y | 9 ++++++++- tests/hlsl/default-values.shader_test | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index f5611e67..c7af2a10 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2629,7 +2629,14 @@ static struct hlsl_block *initialize_vars(struct hlsl_ctx *ctx, struct list *var if (is_default_values_initializer) { - assert(!var->default_values); + /* Default values might have been allocated already for another variable of the same name, + in the same scope. */ + if (var->default_values) + { + free_parse_variable_def(v); + continue; + } + if (!(var->default_values = hlsl_calloc(ctx, component_count, sizeof(*var->default_values)))) { free_parse_variable_def(v); diff --git a/tests/hlsl/default-values.shader_test b/tests/hlsl/default-values.shader_test index 4dbb2a8c..0d319f4d 100644 --- a/tests/hlsl/default-values.shader_test +++ b/tests/hlsl/default-values.shader_test @@ -320,3 +320,12 @@ float4 main() : sv_target { return u.y; } + +[pixel shader fail] +float a = 1; +int a = 2; + +float4 main() : sv_target +{ + return 0; +}
1
0
0
0
Nikolay Sivov : vkd3d-shader/fx: Add missing fields for structure types on fx_5_0.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: vkd3d Branch: master Commit: 0a344bd3c94bfdf25f02d5284f9c37638c2156dd URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/0a344bd3c94bfdf25f02d5284f9c3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jun 30 23:39:30 2024 +0200 vkd3d-shader/fx: Add missing fields for structure types on fx_5_0. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- libs/vkd3d-shader/fx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index a467c236..9acb1f79 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -536,6 +536,12 @@ static uint32_t write_fx_4_type(const struct hlsl_type *type, struct fx_write_co put_u32_unaligned(buffer, field->offset); put_u32_unaligned(buffer, field->type); } + + if (ctx->profile->major_version == 5) + { + put_u32_unaligned(buffer, 0); /* Base class type */ + put_u32_unaligned(buffer, 0); /* Interface count */ + } } else if (type->class == HLSL_CLASS_TEXTURE) {
1
0
0
0
Nikolay Sivov : vkd3d-shader/fx: Preserve parsing order of initializer components.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: vkd3d Branch: master Commit: 8738e4662ed68b59047fbfb7614f71af09962491 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/8738e4662ed68b59047fbfb7614f7…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jun 14 02:26:19 2024 +0200 vkd3d-shader/fx: Preserve parsing order of initializer components. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- libs/vkd3d-shader/hlsl.y | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index b9f0deda..f5611e67 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -2224,6 +2224,9 @@ static unsigned int get_component_index_from_default_initializer_index(struct hl if (ctx->profile->major_version < 4) return index; + if (ctx->profile->type == VKD3D_SHADER_TYPE_EFFECT) + return index; + switch (type->class) { case HLSL_CLASS_MATRIX:
1
0
0
0
Nikolay Sivov : vkd3d-shader/fx: Fix packed size for fx_4+ types.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: vkd3d Branch: master Commit: c97c652ff07a4c812fee64ee14b96ad0ec2ab89f URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/c97c652ff07a4c812fee64ee14b96…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jun 30 23:31:50 2024 +0200 vkd3d-shader/fx: Fix packed size for fx_4+ types. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- libs/vkd3d-shader/fx.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index 558e3275..a467c236 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -433,8 +433,8 @@ static uint32_t write_fx_4_type(const struct hlsl_type *type, struct fx_write_co uint32_t offset; uint32_t type; }; + uint32_t name_offset, offset, total_size, packed_size, stride, numeric_desc; struct vkd3d_bytecode_buffer *buffer = &fx->unstructured; - uint32_t name_offset, offset, size, stride, numeric_desc; struct field_offsets *field_offsets = NULL; struct hlsl_ctx *ctx = fx->ctx; uint32_t elements_count = 0; @@ -507,15 +507,22 @@ static uint32_t write_fx_4_type(const struct hlsl_type *type, struct fx_write_co return 0; } - size = stride = type->reg_size[HLSL_REGSET_NUMERIC] * sizeof(float); + /* Structures can only contain numeric fields, this is validated during variable declaration. */ + total_size = stride = type->reg_size[HLSL_REGSET_NUMERIC] * sizeof(float); + packed_size = 0; + if (type->class == HLSL_CLASS_STRUCT || hlsl_is_numeric_type(type)) + packed_size = hlsl_type_component_count(type) * sizeof(float); if (elements_count) - size *= elements_count; + { + total_size *= elements_count; + packed_size *= elements_count; + } stride = align(stride, 4 * sizeof(float)); put_u32_unaligned(buffer, elements_count); - put_u32_unaligned(buffer, size); /* Total size. */ - put_u32_unaligned(buffer, stride); /* Stride. */ - put_u32_unaligned(buffer, size); + put_u32_unaligned(buffer, total_size); + put_u32_unaligned(buffer, stride); + put_u32_unaligned(buffer, packed_size); if (type->class == HLSL_CLASS_STRUCT) {
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
...
52
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
Results per page:
10
25
50
100
200