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
January 2024
----- 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
711 discussions
Start a n
N
ew thread
Henri Verbeet : vkd3d: Use debugstr_hresult() in vkd3d_create_vk_device().
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: vkd3d Branch: master Commit: 8dc1239e145dba1021ee5396be4ca4571e356827 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/8dc1239e145dba1021ee5396be4ca…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jan 17 18:04:26 2024 +0100 vkd3d: Use debugstr_hresult() in vkd3d_create_vk_device(). --- libs/vkd3d/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 3c544bf9..80fa9d35 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -2071,7 +2071,7 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device, if (FAILED(hr = vkd3d_load_vk_device_procs(&device->vk_procs, vk_procs, vk_device))) { - ERR("Failed to load device procs, hr %#x.\n", hr); + ERR("Failed to load device procs, hr %s.\n", debugstr_hresult(hr)); if (device->vk_procs.vkDestroyDevice) device->vk_procs.vkDestroyDevice(vk_device, NULL); return hr; @@ -2081,7 +2081,7 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device, if (FAILED(hr = d3d12_device_create_vkd3d_queues(device, &device_queue_info))) { - ERR("Failed to create queues, hr %#x.\n", hr); + ERR("Failed to create queues, hr %s.\n", debugstr_hresult(hr)); device->vk_procs.vkDestroyDevice(vk_device, NULL); return hr; }
1
0
0
0
Henri Verbeet : vkd3d: Use debugstr_hresult() in vkd3d_instance_init().
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: vkd3d Branch: master Commit: af160ef0c4c2b656437431b08638143227753c45 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/af160ef0c4c2b656437431b086381…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jan 17 17:56:23 2024 +0100 vkd3d: Use debugstr_hresult() in vkd3d_instance_init(). --- libs/vkd3d/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 75efa41f..3c544bf9 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -594,7 +594,7 @@ static HRESULT vkd3d_instance_init(struct vkd3d_instance *instance, if (FAILED(hr = vkd3d_init_vk_global_procs(instance, create_info->pfn_vkGetInstanceProcAddr))) { - ERR("Failed to initialize Vulkan global procs, hr %#x.\n", hr); + ERR("Failed to initialise Vulkan global procs, hr %s.\n", debugstr_hresult(hr)); return hr; } @@ -674,7 +674,7 @@ static HRESULT vkd3d_instance_init(struct vkd3d_instance *instance, if (FAILED(hr = vkd3d_load_vk_instance_procs(&instance->vk_procs, vk_global_procs, vk_instance))) { - ERR("Failed to load instance procs, hr %#x.\n", hr); + ERR("Failed to load instance procs, hr %s.\n", debugstr_hresult(hr)); if (instance->vk_procs.vkDestroyInstance) instance->vk_procs.vkDestroyInstance(vk_instance, NULL); if (instance->libvulkan)
1
0
0
0
Conor McCarthy : vkd3d-shader/spirv: Emit DISCARD as a function call.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: vkd3d Branch: master Commit: e4660fe0e694021b7041ec3d1f6e730caa2fca5c URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/e4660fe0e694021b7041ec3d1f6e7…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Jan 23 16:47:26 2024 +1000 vkd3d-shader/spirv: Emit DISCARD as a function call. --- libs/vkd3d-shader/spirv.c | 61 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index ec9786ea..9286e87d 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2328,6 +2328,7 @@ struct spirv_compiler uint32_t private_output_variable[MAX_REG_OUTPUT + 1]; /* 1 entry for oDepth */ uint32_t private_output_variable_write_mask[MAX_REG_OUTPUT + 1]; /* 1 entry for oDepth */ uint32_t epilogue_function_id; + uint32_t discard_function_id; uint32_t binding_idx; @@ -7626,16 +7627,39 @@ static void spirv_compiler_emit_retc(struct spirv_compiler *compiler, vkd3d_spirv_build_op_label(builder, merge_block_id); } -static void spirv_compiler_emit_kill(struct spirv_compiler *compiler, - const struct vkd3d_shader_instruction *instruction) +static uint32_t spirv_compiler_get_discard_function_id(struct spirv_compiler *compiler) { struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; - uint32_t target_id, merge_block_id; - target_id = vkd3d_spirv_alloc_id(builder); - merge_block_id = spirv_compiler_emit_conditional_branch(compiler, instruction, target_id); + if (!compiler->discard_function_id) + compiler->discard_function_id = vkd3d_spirv_alloc_id(builder); - vkd3d_spirv_build_op_label(builder, target_id); + return compiler->discard_function_id; +} + +static void spirv_compiler_emit_discard_function(struct spirv_compiler *compiler) +{ + uint32_t void_id, bool_id, function_type_id, condition_id, target_block_id, merge_block_id; + struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; + + vkd3d_spirv_build_op_name(builder, compiler->discard_function_id, "discard"); + + void_id = vkd3d_spirv_get_op_type_void(builder); + bool_id = vkd3d_spirv_get_op_type_bool(builder); + function_type_id = vkd3d_spirv_get_op_type_function(builder, void_id, &bool_id, 1); + + vkd3d_spirv_build_op_function(builder, void_id, compiler->discard_function_id, + SpvFunctionControlMaskNone, function_type_id); + condition_id = vkd3d_spirv_build_op_function_parameter(builder, bool_id); + + vkd3d_spirv_build_op_label(builder, vkd3d_spirv_alloc_id(builder)); + + target_block_id = vkd3d_spirv_alloc_id(builder); + merge_block_id = vkd3d_spirv_alloc_id(builder); + vkd3d_spirv_build_op_selection_merge(builder, merge_block_id, SpvSelectionControlMaskNone); + vkd3d_spirv_build_op_branch_conditional(builder, condition_id, target_block_id, merge_block_id); + + vkd3d_spirv_build_op_label(builder, target_block_id); if (spirv_compiler_is_target_extension_supported(compiler, VKD3D_SHADER_SPIRV_EXTENSION_EXT_DEMOTE_TO_HELPER_INVOCATION)) @@ -7650,6 +7674,26 @@ static void spirv_compiler_emit_kill(struct spirv_compiler *compiler, } vkd3d_spirv_build_op_label(builder, merge_block_id); + vkd3d_spirv_build_op_return(builder); + vkd3d_spirv_build_op_function_end(builder); +} + +static void spirv_compiler_emit_discard(struct spirv_compiler *compiler, + const struct vkd3d_shader_instruction *instruction) +{ + struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; + const struct vkd3d_shader_src_param *src = instruction->src; + uint32_t condition_id, void_id; + + /* discard is not a block terminator in VSIR, and emitting it as such in SPIR-V would cause + * a mismatch between the VSIR structure and the SPIR-V one, which would cause problems if + * structurisation is necessary. Therefore we emit it as a function call. */ + condition_id = spirv_compiler_emit_load_src(compiler, src, VKD3DSP_WRITEMASK_0); + condition_id = spirv_compiler_emit_int_to_bool(compiler, + instruction->flags, src->reg.data_type, 1, condition_id); + void_id = vkd3d_spirv_get_op_type_void(builder); + vkd3d_spirv_build_op_function_call(builder, void_id, spirv_compiler_get_discard_function_id(compiler), + &condition_id, 1); } static bool spirv_compiler_init_blocks(struct spirv_compiler *compiler, unsigned int block_count) @@ -9515,7 +9559,7 @@ static int spirv_compiler_handle_instruction(struct spirv_compiler *compiler, break; case VKD3DSIH_DISCARD: case VKD3DSIH_TEXKILL: - spirv_compiler_emit_kill(compiler, instruction); + spirv_compiler_emit_discard(compiler, instruction); break; case VKD3DSIH_LABEL: spirv_compiler_emit_label(compiler, instruction); @@ -9801,6 +9845,9 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler, } } + if (compiler->discard_function_id) + spirv_compiler_emit_discard_function(compiler); + if (compiler->epilogue_function_id) { vkd3d_spirv_build_op_name(builder, compiler->epilogue_function_id, "epilogue");
1
0
0
0
Conor McCarthy : vkd3d-shader/dxil: Use strcmp() to find the handle type.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: vkd3d Branch: master Commit: 367a06d748db377e699c49fde616bf32b7a386d1 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/367a06d748db377e699c49fde616b…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Jan 23 15:22:19 2024 +1000 vkd3d-shader/dxil: Use strcmp() to find the handle type. We use strcmp() on the same type name elsewhere, and case-insensitive matching does not seem necessary. --- libs/vkd3d-shader/dxil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index b71d04b1..6b38f028 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -1634,7 +1634,7 @@ static enum vkd3d_result sm6_parser_type_table_init(struct sm6_parser *sm6) break; } - if (!ascii_strcasecmp(struct_name, "dx.types.Handle")) + if (!strcmp(struct_name, "dx.types.Handle")) sm6->handle_type = type; type->u.struc->name = struct_name;
1
0
0
0
Conor McCarthy : vkd3d-shader/dxil: Use strcmp() to find function names.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: vkd3d Branch: master Commit: 1cca18a22878b398ba693bdc19967f8db05d2581 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/1cca18a22878b398ba693bdc19967…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Jan 23 15:18:28 2024 +1000 vkd3d-shader/dxil: Use strcmp() to find function names. Function names are case-sensitive. --- libs/vkd3d-shader/dxil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 0f94e799..b71d04b1 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -6954,7 +6954,7 @@ static struct sm6_function *sm6_parser_get_function(const struct sm6_parser *sm6 { size_t i; for (i = 0; i < sm6->function_count; ++i) - if (!ascii_strcasecmp(sm6->functions[i].declaration->u.function.name, name)) + if (!strcmp(sm6->functions[i].declaration->u.function.name, name)) return &sm6->functions[i]; return NULL; }
1
0
0
0
Conor McCarthy : vkd3d-shader/dxil: Use strcmp() to check the entry point name.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: vkd3d Branch: master Commit: 4dec25cbdea47d9ddb12868e34a05da489705506 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/4dec25cbdea47d9ddb12868e34a05…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Jan 23 15:16:29 2024 +1000 vkd3d-shader/dxil: Use strcmp() to check the entry point name. Function names are case-sensitive. --- libs/vkd3d-shader/dxil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 48664b5a..0f94e799 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -6764,7 +6764,7 @@ static enum vkd3d_result sm6_parser_entry_point_init(struct sm6_parser *sm6) sm6->entry_point = value->u.function.name; if (!sm6_metadata_value_is_string(entry_node->operands[1]) - || ascii_strcasecmp(sm6->entry_point, entry_node->operands[1]->u.string_value)) + || strcmp(sm6->entry_point, entry_node->operands[1]->u.string_value)) { WARN("Entry point function name %s mismatch.\n", sm6->entry_point); vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_ENTRY_POINT_MISMATCH,
1
0
0
0
Zebediah Figura : tests: Add tests for valid conditional types.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: vkd3d Branch: master Commit: 57c4a13024f144ed39a8e21e13fad27fc39ff0d9 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/57c4a13024f144ed39a8e21e13fad…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Jun 30 19:04:33 2023 -0500 tests: Add tests for valid conditional types. --- Makefile.am | 1 + tests/hlsl/cf-cond-types.shader_test | 131 +++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+) diff --git a/Makefile.am b/Makefile.am index 1b9abc35..1810b24f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -73,6 +73,7 @@ vkd3d_shader_tests = \ tests/hlsl/cast-to-uint.shader_test \ tests/hlsl/cbuffer.shader_test \ tests/hlsl/ceil.shader_test \ + tests/hlsl/cf-cond-types.shader_test \ tests/hlsl/clamp.shader_test \ tests/hlsl/clip.shader_test \ tests/hlsl/combined-samplers.shader_test \ diff --git a/tests/hlsl/cf-cond-types.shader_test b/tests/hlsl/cf-cond-types.shader_test new file mode 100644 index 00000000..9a6e800a --- /dev/null +++ b/tests/hlsl/cf-cond-types.shader_test @@ -0,0 +1,131 @@ +% Condition to if/for/while must be numeric. They must also be 1-component +% (although not per se scalar — vectors and matrices are allowed, but not +% arrays). +% +% In theory an implicit conversion to bool is being performed, except that, +% unlike other places where implicit conversions are performed (assignments, +% return values) vectors are not truncated, but instead result in an error. + +[pixel shader fail] +static const float2 f; +float4 main() : sv_target +{ + if (f); + return 0; +} + +[pixel shader fail] +static const float f[1]; +float4 main() : sv_target +{ + if (f); + return 0; +} + +[pixel shader fail] +static const Texture2D f; +float4 main() : sv_target +{ + if (f); + return 0; +} + +[pixel shader fail] +static const float2 f; +float4 main() : sv_target +{ + while (f); + return 0; +} + +[pixel shader fail] +static const float f[1]; +float4 main() : sv_target +{ + while (f); + return 0; +} + +[pixel shader fail] +static const Texture2D f; +float4 main() : sv_target +{ + while (f); + return 0; +} + +[pixel shader fail] +static const float2 f; +float4 main() : sv_target +{ + do; while(f); + return 0; +} + +[pixel shader fail] +static const float f[1]; +float4 main() : sv_target +{ + do; while(f); + return 0; +} + +[pixel shader fail] +static const Texture2D f; +float4 main() : sv_target +{ + do; while(f); + return 0; +} + +[pixel shader fail] +static const float2 f; +float4 main() : sv_target +{ + for (; f;); + return 0; +} + +[pixel shader fail] +static const float f[1]; +float4 main() : sv_target +{ + for (; f;); + return 0; +} + +[pixel shader fail] +static const Texture2D f; +float4 main() : sv_target +{ + for (; f;); + return 0; +} + +[pixel shader todo] +static const float1x1 f; +float4 main() : sv_target +{ + if (f); + for (; f;); + while (f); + do; while (f); + return 0; +} + +[pixel shader] +uniform float1 f; +float4 main() : sv_target +{ + if (f) + return 1; + return 0; +} + +[test] +uniform 0 float4 -2.0 0.0 0.0 0.0 +draw quad +probe all rgba (1.0, 1.0, 1.0, 1.0) +uniform 0 float4 -0.0 0.0 0.0 0.0 +draw quad +probe all rgba (0.0, 0.0, 0.0, 0.0)
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Always cast to bool in if() statements.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: vkd3d Branch: master Commit: a8b0c0391273bbeeec9ca9438fc0d2fa8d2ccd90 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/a8b0c0391273bbeeec9ca9438fc0d…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Mon Jan 22 14:51:02 2024 -0600 vkd3d-shader/hlsl: Always cast to bool in if() statements. We emit sm4 if_nz for these, but that does a bitwise comparison to zero, which is wrong for floats. --- libs/vkd3d-shader/hlsl.y | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index c934aaae..8dc353e1 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -6763,6 +6763,15 @@ selection_statement: } } + check_condition_type(ctx, condition); + + if (!(condition = add_cast(ctx, $4, condition, hlsl_get_scalar_type(ctx, HLSL_TYPE_BOOL), &@4))) + { + destroy_block($6.then_block); + destroy_block($6.else_block); + YYABORT; + } + if (!(instr = hlsl_new_if(ctx, condition, $6.then_block, $6.else_block, &@2))) { destroy_block($6.then_block); @@ -6772,8 +6781,6 @@ selection_statement: destroy_block($6.then_block); destroy_block($6.else_block); - check_condition_type(ctx, condition); - $$ = $4; hlsl_block_add_instr($$, instr); }
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Validate that condition expressions are numeric.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: vkd3d Branch: master Commit: 183172eff4cfe53e0e36abb875f083f18f9da439 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/183172eff4cfe53e0e36abb875f08…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Jun 30 19:04:00 2023 -0500 vkd3d-shader/hlsl: Validate that condition expressions are numeric. --- libs/vkd3d-shader/hlsl.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index c2e9b525..c934aaae 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -296,7 +296,7 @@ static void check_condition_type(struct hlsl_ctx *ctx, const struct hlsl_ir_node { const struct hlsl_type *type = cond->data_type; - if (type->dimx > 1 || type->dimy > 1) + if (type->class > HLSL_CLASS_LAST_NUMERIC || type->dimx > 1 || type->dimy > 1) { struct vkd3d_string_buffer *string;
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Validate the condition data type for loops as well.
by Alexandre Julliard
23 Jan '24
23 Jan '24
Module: vkd3d Branch: master Commit: 09220edd2114cf5565f9c17434f217ebe37d60b9 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/09220edd2114cf5565f9c17434f21…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Jun 30 18:50:11 2023 -0500 vkd3d-shader/hlsl: Validate the condition data type for loops as well. --- libs/vkd3d-shader/hlsl.y | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 69b20973..c2e9b525 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -292,6 +292,21 @@ static bool implicit_compatible_data_types(struct hlsl_ctx *ctx, struct hlsl_typ return hlsl_types_are_componentwise_equal(ctx, src, dst); } +static void check_condition_type(struct hlsl_ctx *ctx, const struct hlsl_ir_node *cond) +{ + const struct hlsl_type *type = cond->data_type; + + if (type->dimx > 1 || type->dimy > 1) + { + struct vkd3d_string_buffer *string; + + if ((string = hlsl_type_to_string(ctx, type))) + hlsl_error(ctx, &cond->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE, + "Condition type '%s' is not a scalar numeric type.", string->buffer); + hlsl_release_string_buffer(ctx, string); + } +} + static struct hlsl_ir_node *add_cast(struct hlsl_ctx *ctx, struct hlsl_block *block, struct hlsl_ir_node *node, struct hlsl_type *dst_type, const struct vkd3d_shader_location *loc) { @@ -431,6 +446,9 @@ static bool append_conditional_break(struct hlsl_ctx *ctx, struct hlsl_block *co return true; condition = node_from_block(cond_block); + + check_condition_type(ctx, condition); + if (!(not = hlsl_new_unary_expr(ctx, HLSL_OP1_LOGIC_NOT, condition, &condition->loc))) return false; hlsl_block_add_instr(cond_block, not); @@ -6753,15 +6771,9 @@ selection_statement: } destroy_block($6.then_block); destroy_block($6.else_block); - if (condition->data_type->dimx > 1 || condition->data_type->dimy > 1) - { - struct vkd3d_string_buffer *string; - if ((string = hlsl_type_to_string(ctx, condition->data_type))) - hlsl_error(ctx, &instr->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE, - "if condition type %s is not scalar.", string->buffer); - hlsl_release_string_buffer(ctx, string); - } + check_condition_type(ctx, condition); + $$ = $4; hlsl_block_add_instr($$, instr); }
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
72
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
Results per page:
10
25
50
100
200