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
August 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
667 discussions
Start a n
N
ew thread
Conor McCarthy : vkd3d-shader/tpf: Handle the dimension bitfield in src param tokens.
by Alexandre Julliard
28 Aug '23
28 Aug '23
Module: vkd3d Branch: master Commit: 7e5d9e3b6fc5c4646a48ee306c26ebb57a19740c URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/7e5d9e3b6fc5c4646a48ee306c26e…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Aug 8 11:38:26 2023 +1000 vkd3d-shader/tpf: Handle the dimension bitfield in src param tokens. --- libs/vkd3d-shader/spirv.c | 18 +++++++++- libs/vkd3d-shader/tpf.c | 62 +++++++++++++++++++------------- libs/vkd3d-shader/vkd3d_shader_private.h | 4 +++ 3 files changed, 59 insertions(+), 25 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index fa605f18..f1644587 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2643,6 +2643,16 @@ static void VKD3D_PRINTF_FUNC(3, 4) spirv_compiler_error(struct spirv_compiler * compiler->failed = true; } +static void VKD3D_PRINTF_FUNC(3, 4) spirv_compiler_warning(struct spirv_compiler *compiler, + enum vkd3d_shader_error error, const char *format, ...) +{ + va_list args; + + va_start(args, format); + vkd3d_shader_vwarning(compiler->message_context, &compiler->location, error, format, args); + va_end(args); +} + static struct vkd3d_string_buffer *vkd3d_shader_register_range_string(struct spirv_compiler *compiler, const struct vkd3d_shader_register_range *range) { @@ -7466,7 +7476,13 @@ static int spirv_compiler_emit_control_flow_instruction(struct spirv_compiler *c assert(compiler->control_flow_depth); assert(cf_info->current_block == VKD3D_BLOCK_SWITCH); - assert(src->swizzle == VKD3D_SHADER_NO_SWIZZLE && src->reg.type == VKD3DSPR_IMMCONST); + if (src->swizzle != VKD3D_SHADER_SWIZZLE(X, X, X, X)) + { + WARN("Unexpected src swizzle %#x.\n", src->swizzle); + spirv_compiler_warning(compiler, VKD3D_SHADER_WARNING_SPV_INVALID_SWIZZLE, + "The swizzle for a switch case value is not scalar."); + } + assert(src->reg.type == VKD3DSPR_IMMCONST); value = *src->reg.u.immconst_uint; if (!vkd3d_array_reserve((void **)&cf_info->u.switch_.case_blocks, &cf_info->u.switch_.case_blocks_size, diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index 461a110a..e00dfd5e 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -2026,6 +2026,7 @@ static bool shader_sm4_validate_input_output_register(struct vkd3d_shader_sm4_pa static bool shader_sm4_read_src_param(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, const uint32_t *end, enum vkd3d_data_type data_type, struct vkd3d_shader_src_param *src_param) { + unsigned int dimension; DWORD token; if (*ptr >= end) @@ -2041,37 +2042,50 @@ static bool shader_sm4_read_src_param(struct vkd3d_shader_sm4_parser *priv, cons return false; } - if (src_param->reg.type == VKD3DSPR_IMMCONST || src_param->reg.type == VKD3DSPR_IMMCONST64) + switch ((dimension = (token & VKD3D_SM4_DIMENSION_MASK) >> VKD3D_SM4_DIMENSION_SHIFT)) { - src_param->swizzle = VKD3D_SHADER_NO_SWIZZLE; - } - else - { - enum vkd3d_sm4_swizzle_type swizzle_type = - (token & VKD3D_SM4_SWIZZLE_TYPE_MASK) >> VKD3D_SM4_SWIZZLE_TYPE_SHIFT; + case VKD3D_SM4_DIMENSION_NONE: + case VKD3D_SM4_DIMENSION_SCALAR: + src_param->swizzle = VKD3D_SHADER_SWIZZLE(X, X, X, X); + break; - switch (swizzle_type) + case VKD3D_SM4_DIMENSION_VEC4: { - case VKD3D_SM4_SWIZZLE_NONE: - if (shader_sm4_is_scalar_register(&src_param->reg)) - src_param->swizzle = VKD3D_SHADER_SWIZZLE(X, X, X, X); - else - src_param->swizzle = VKD3D_SHADER_NO_SWIZZLE; - break; + enum vkd3d_sm4_swizzle_type swizzle_type = + (token & VKD3D_SM4_SWIZZLE_TYPE_MASK) >> VKD3D_SM4_SWIZZLE_TYPE_SHIFT; - case VKD3D_SM4_SWIZZLE_SCALAR: - src_param->swizzle = (token & VKD3D_SM4_SWIZZLE_MASK) >> VKD3D_SM4_SWIZZLE_SHIFT; - src_param->swizzle = (src_param->swizzle & 0x3) * 0x01010101; - break; + switch (swizzle_type) + { + case VKD3D_SM4_SWIZZLE_NONE: + if (shader_sm4_is_scalar_register(&src_param->reg)) + src_param->swizzle = VKD3D_SHADER_SWIZZLE(X, X, X, X); + else + src_param->swizzle = VKD3D_SHADER_NO_SWIZZLE; + break; - case VKD3D_SM4_SWIZZLE_VEC4: - src_param->swizzle = swizzle_from_sm4((token & VKD3D_SM4_SWIZZLE_MASK) >> VKD3D_SM4_SWIZZLE_SHIFT); - break; + case VKD3D_SM4_SWIZZLE_SCALAR: + src_param->swizzle = (token & VKD3D_SM4_SWIZZLE_MASK) >> VKD3D_SM4_SWIZZLE_SHIFT; + src_param->swizzle = (src_param->swizzle & 0x3) * 0x01010101; + break; - default: - FIXME("Unhandled swizzle type %#x.\n", swizzle_type); - break; + case VKD3D_SM4_SWIZZLE_VEC4: + src_param->swizzle = swizzle_from_sm4((token & VKD3D_SM4_SWIZZLE_MASK) >> VKD3D_SM4_SWIZZLE_SHIFT); + break; + + default: + FIXME("Unhandled swizzle type %#x.\n", swizzle_type); + vkd3d_shader_parser_error(&priv->p, VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_SWIZZLE, + "Source register swizzle type %#x is invalid.", swizzle_type); + break; + } + break; } + + default: + FIXME("Unhandled dimension %#x.\n", dimension); + vkd3d_shader_parser_error(&priv->p, VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_DIMENSION, + "Source register dimension %#x is invalid.", dimension); + break; } if (register_is_input_output(&src_param->reg) && !shader_sm4_validate_input_output_register(priv, diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index df0273cb..c6be6f22 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -79,6 +79,8 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_TPF_INVALID_IO_REGISTER = 1005, VKD3D_SHADER_ERROR_TPF_INVALID_INDEX_RANGE_DCL = 1006, VKD3D_SHADER_ERROR_TPF_INVALID_CASE_VALUE = 1007, + VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_DIMENSION = 1008, + VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_SWIZZLE = 1009, VKD3D_SHADER_WARNING_TPF_MASK_NOT_CONTIGUOUS = 1300, VKD3D_SHADER_WARNING_TPF_UNHANDLED_INDEX_RANGE_MASK = 1301, @@ -89,6 +91,8 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_SPV_DESCRIPTOR_IDX_UNSUPPORTED = 2003, VKD3D_SHADER_ERROR_SPV_STENCIL_EXPORT_UNSUPPORTED = 2004, + VKD3D_SHADER_WARNING_SPV_INVALID_SWIZZLE = 2300, + VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY = 3000, VKD3D_SHADER_ERROR_RS_INVALID_VERSION = 3001, VKD3D_SHADER_ERROR_RS_INVALID_ROOT_PARAMETER_TYPE = 3002,
1
0
0
0
Conor McCarthy : vkd3d-shader/tpf: Validate the src register of case conditions.
by Alexandre Julliard
28 Aug '23
28 Aug '23
Module: vkd3d Branch: master Commit: 5c706152fa805eb5ef88d5f397e32654d29a5cab URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/5c706152fa805eb5ef88d5f397e32…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Mon Aug 28 12:55:47 2023 +1000 vkd3d-shader/tpf: Validate the src register of case conditions. Case values are constants in TPF. --- libs/vkd3d-shader/tpf.c | 16 +++++++++++++++- libs/vkd3d-shader/vkd3d_shader_private.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index cf2cc0d1..461a110a 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -707,6 +707,19 @@ static void shader_sm4_read_conditional_op(struct vkd3d_shader_instruction *ins, VKD3D_SHADER_CONDITIONAL_OP_NZ : VKD3D_SHADER_CONDITIONAL_OP_Z; } +static void shader_sm4_read_case_condition(struct vkd3d_shader_instruction *ins, uint32_t opcode, + uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv) +{ + shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], VKD3D_DATA_UINT, + (struct vkd3d_shader_src_param *)&ins->src[0]); + if (ins->src[0].reg.type != VKD3DSPR_IMMCONST) + { + FIXME("Switch case value is not a 32-bit constant.\n"); + vkd3d_shader_parser_error(&priv->p, VKD3D_SHADER_ERROR_TPF_INVALID_CASE_VALUE, + "Switch case value is not a 32-bit immediate constant register."); + } +} + static void shader_sm4_read_shader_data(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv) { @@ -1215,7 +1228,8 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = {VKD3D_SM4_OP_BREAK, VKD3DSIH_BREAK, "", ""}, {VKD3D_SM4_OP_BREAKC, VKD3DSIH_BREAKP, "", "u", shader_sm4_read_conditional_op}, - {VKD3D_SM4_OP_CASE, VKD3DSIH_CASE, "", "u"}, + {VKD3D_SM4_OP_CASE, VKD3DSIH_CASE, "", "u", + shader_sm4_read_case_condition}, {VKD3D_SM4_OP_CONTINUE, VKD3DSIH_CONTINUE, "", ""}, {VKD3D_SM4_OP_CONTINUEC, VKD3DSIH_CONTINUEP, "", "u", shader_sm4_read_conditional_op}, diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 7cfaba56..df0273cb 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -78,6 +78,7 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_TPF_TOO_MANY_REGISTERS = 1004, VKD3D_SHADER_ERROR_TPF_INVALID_IO_REGISTER = 1005, VKD3D_SHADER_ERROR_TPF_INVALID_INDEX_RANGE_DCL = 1006, + VKD3D_SHADER_ERROR_TPF_INVALID_CASE_VALUE = 1007, VKD3D_SHADER_WARNING_TPF_MASK_NOT_CONTIGUOUS = 1300, VKD3D_SHADER_WARNING_TPF_UNHANDLED_INDEX_RANGE_MASK = 1301,
1
0
0
0
Alexandre Julliard : wow64: Reimplement syscall resolution using the syscall dispatcher name table.
by Alexandre Julliard
25 Aug '23
25 Aug '23
Module: wine Branch: master Commit: 221d5aba3f19c1014dad30cad04c4b14c284d9d2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/221d5aba3f19c1014dad30cad04c4b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Aug 25 13:14:32 2023 +0200 wow64: Reimplement syscall resolution using the syscall dispatcher name table. --- dlls/wow64/syscall.c | 164 +++++++++++++++------------------------------------ 1 file changed, 46 insertions(+), 118 deletions(-) diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index 6b1da0913a9..113e9f538fb 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -643,99 +643,68 @@ NTSTATUS WINAPI wow64_NtWow64IsProcessorFeaturePresent( UINT *args ) } -/********************************************************************** - * get_syscall_num - */ -static DWORD get_syscall_num( const BYTE *syscall ) -{ - WORD *arm_syscall = (WORD *)((ULONG_PTR)syscall & ~1); - DWORD id = ~0u; - - if (!syscall) return id; - switch (current_machine) - { - case IMAGE_FILE_MACHINE_I386: - if (syscall[0] == 0xb8 && syscall[5] == 0xba && syscall[10] == 0xff && syscall[11] == 0xd2) - id = *(DWORD *)(syscall + 1); - break; - - case IMAGE_FILE_MACHINE_ARMNT: - if (*arm_syscall == 0xb40f) - { - DWORD inst = *(DWORD *)(arm_syscall + 1); - id = ((inst << 1) & 0x0800) + ((inst << 12) & 0xf000) + - ((inst >> 20) & 0x0700) + ((inst >> 16) & 0x00ff); - } - break; - } - return id; -} - - /********************************************************************** * get_rva */ -static void *get_rva( const IMAGE_NT_HEADERS *nt, HMODULE module, DWORD rva, - IMAGE_SECTION_HEADER **section, BOOL image ) +static void *get_rva( HMODULE module, DWORD rva ) { - if (image) return (void *)((char *)module + rva); - return RtlImageRvaToVa( nt, module, rva, section ); + return (void *)((char *)module + rva); } /********************************************************************** * init_syscall_table */ -static void init_syscall_table( HMODULE module, ULONG idx, const SYSTEM_SERVICE_TABLE *orig_table, BOOL image ) +static void init_syscall_table( HMODULE module, void *dispatcher, const SYSTEM_SERVICE_TABLE *orig_table ) { static syscall_thunk thunks[2048]; static ULONG start_pos; - const IMAGE_NT_HEADERS *nt = RtlImageNtHeader( module ); - IMAGE_SECTION_HEADER *section = NULL; + struct syscall_info32 + { + UINT dispatcher; + UINT version; + USHORT id; + USHORT limit; + /* USHORT names[limit]; */ + /* BYTE args[limit]; */ + } *info = dispatcher; + + const USHORT *name_ptrs = (const USHORT *)(info + 1); const IMAGE_EXPORT_DIRECTORY *exports; - const ULONG *functions, *names; - const USHORT *ordinals; - ULONG id, exp_size, exp_pos, wrap_pos, max_pos = 0; + const ULONG *names; + ULONG id, exp_size, wrap_pos; const char **syscall_names = (const char **)orig_table->CounterTable; - exports = RtlImageDirectoryEntryToData( module, image, IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size ); - ordinals = get_rva( nt, module, exports->AddressOfNameOrdinals, §ion, image ); - functions = get_rva( nt, module, exports->AddressOfFunctions, §ion, image ); - names = get_rva( nt, module, exports->AddressOfNames, §ion, image ); - - for (exp_pos = wrap_pos = 0; exp_pos < exports->NumberOfNames; exp_pos++) + if (info->version != 0xca110001) { - char *name = get_rva( nt, module, names[exp_pos], §ion, image ); - int res = -1; + WARN( "invalid syscall table version %x\n", info->version ); + return; + } + if (syscall_tables[info->id].ServiceTable) return; /* already initialized */ - if (strncmp( name, "Nt", 2 ) && strncmp( name, "wine", 4 ) && strncmp( name, "__wine", 6 )) - continue; /* not a syscall */ + exports = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size ); + names = get_rva( module, exports->AddressOfNames ); - id = get_syscall_num( get_rva( nt, module, functions[ordinals[exp_pos]], §ion, image )); - if (id == ~0u) continue; /* not a syscall */ + for (id = wrap_pos = 0; id < info->limit; id++) + { + char *name = get_rva( module, names[name_ptrs[id]] ); + int res = -1; if (wrap_pos < orig_table->ServiceLimit) res = strcmp( name, syscall_names[wrap_pos] ); if (!res) /* got a match */ { - ULONG table_idx = (id >> 12) & 3, table_pos = id & 0xfff; - if (table_idx == idx) - { - if (start_pos + table_pos < ARRAY_SIZE(thunks)) - { - thunks[start_pos + table_pos] = (syscall_thunk)orig_table->ServiceTable[wrap_pos++]; - max_pos = max( table_pos, max_pos ); - } - else ERR( "invalid syscall id %04lx for %s\n", id, name ); - } - else ERR( "wrong syscall table id %04lx for %s\n", id, name ); + if (start_pos + id < ARRAY_SIZE(thunks)) + thunks[start_pos + id] = (syscall_thunk)orig_table->ServiceTable[wrap_pos++]; + else + ERR( "invalid syscall id %04lx for %s\n", id, name ); } else if (res > 0) { FIXME( "no export for syscall %s\n", syscall_names[wrap_pos] ); wrap_pos++; - exp_pos--; /* try again */ + id--; /* try again */ } else FIXME( "missing wrapper for syscall %04lx %s\n", id, name ); } @@ -743,9 +712,9 @@ static void init_syscall_table( HMODULE module, ULONG idx, const SYSTEM_SERVICE_ for ( ; wrap_pos < orig_table->ServiceLimit; wrap_pos++) FIXME( "no export for syscall %s\n", syscall_names[wrap_pos] ); - syscall_tables[idx].ServiceTable = (ULONG_PTR *)(thunks + start_pos); - syscall_tables[idx].ServiceLimit = max_pos + 1; - start_pos += max_pos + 1; + syscall_tables[info->id].ServiceTable = (ULONG_PTR *)(thunks + start_pos); + syscall_tables[info->id].ServiceLimit = info->limit; + start_pos += info->limit; } @@ -754,58 +723,18 @@ static void init_syscall_table( HMODULE module, ULONG idx, const SYSTEM_SERVICE_ */ void init_image_mapping( HMODULE module ) { - void **ptr = RtlFindExportedRoutineByName( module, "Wow64Transition" ); + ULONG *ptr = RtlFindExportedRoutineByName( module, "Wow64Transition" ); if (!ptr) return; - *ptr = pBTCpuGetBopCode(); + *ptr = PtrToUlong( pBTCpuGetBopCode() ); if (!win32u_module && RtlFindExportedRoutineByName( module, "NtUserInitializeClientPfnArrays" )) { win32u_module = module; - init_syscall_table( win32u_module, 1, psdwhwin32, TRUE ); + init_syscall_table( win32u_module, ptr, psdwhwin32 ); } } -/********************************************************************** - * load_32bit_module - */ -static HMODULE load_32bit_module( const WCHAR *name, WORD machine, BOOL image ) -{ - NTSTATUS status; - OBJECT_ATTRIBUTES attr; - IO_STATUS_BLOCK io; - LARGE_INTEGER size; - UNICODE_STRING str; - SIZE_T len = 0; - void *ptr = NULL; - HANDLE handle, mapping; - WCHAR path[MAX_PATH]; - const WCHAR *dir = get_machine_wow64_dir( machine ); - - swprintf( path, MAX_PATH, L"%s\\%s", dir, name ); - RtlInitUnicodeString( &str, path ); - InitializeObjectAttributes( &attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL ); - - status = NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, - FILE_SHARE_READ | FILE_SHARE_DELETE, - FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE ); - if (status) return NULL; - - size.QuadPart = 0; - status = NtCreateSection( &mapping, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | - SECTION_MAP_READ | SECTION_MAP_EXECUTE, NULL, - &size, PAGE_EXECUTE_READ, image ? SEC_IMAGE : SEC_COMMIT, handle ); - NtClose( handle ); - if (status) return NULL; - - status = NtMapViewOfSection( mapping, NtCurrentProcess(), &ptr, 0, 0, NULL, &len, - ViewShare, 0, PAGE_EXECUTE_READ ); - NtClose( mapping ); - if (!NT_SUCCESS( status )) ptr = NULL; - return ptr; -} - - /********************************************************************** * load_64bit_module */ @@ -875,9 +804,10 @@ static const WCHAR *get_cpu_dll_name(void) static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **context ) { PEB32 *peb32; - HMODULE module, ntdll; + HMODULE module; UNICODE_STRING str = RTL_CONSTANT_STRING( L"ntdll.dll" ); SYSTEM_BASIC_INFORMATION info; + ULONG *p__wine_syscall_dispatcher, *p__wine_unix_call_dispatcher; RtlWow64GetProcessMachines( GetCurrentProcess(), ¤t_machine, &native_machine ); if (!current_machine) current_machine = native_machine; @@ -924,16 +854,14 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex module = (HMODULE)(ULONG_PTR)pLdrSystemDllInitBlock->ntdll_handle; init_image_mapping( module ); - *(void **)RtlFindExportedRoutineByName( module, "__wine_syscall_dispatcher" ) = pBTCpuGetBopCode(); - *(void **)RtlFindExportedRoutineByName( module, "__wine_unix_call_dispatcher" ) = p__wine_get_unix_opcode(); GET_PTR( KiRaiseUserExceptionDispatcher ); + GET_PTR( __wine_syscall_dispatcher ); + GET_PTR( __wine_unix_call_dispatcher ); - if ((ntdll = load_32bit_module( L"ntdll.dll", current_machine, FALSE ))) - { - init_syscall_table( ntdll, 0, &ntdll_syscall_table, FALSE ); - NtUnmapViewOfSection( NtCurrentProcess(), ntdll ); - } - else init_syscall_table( module, 0, &ntdll_syscall_table, TRUE ); + *p__wine_syscall_dispatcher = PtrToUlong( pBTCpuGetBopCode() ); + *p__wine_unix_call_dispatcher = PtrToUlong( p__wine_get_unix_opcode() ); + + init_syscall_table( module, p__wine_syscall_dispatcher, &ntdll_syscall_table ); init_file_redirects(); return TRUE;
1
0
0
0
Alexandre Julliard : ntdll: Also store syscall id and names following the syscall dispatcher pointer.
by Alexandre Julliard
25 Aug '23
25 Aug '23
Module: wine Branch: master Commit: 7ee9c19687beeb80474619cd611e08e84dfd82e8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7ee9c19687beeb80474619cd611e08…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Aug 25 12:09:12 2023 +0200 ntdll: Also store syscall id and names following the syscall dispatcher pointer. --- dlls/ntdll/unix/loader.c | 19 +++++++++++++------ dlls/win32u/syscall.c | 2 +- include/wine/unixlib.h | 2 +- tools/winebuild/import.c | 7 +++++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 8d5fc79895c..a32d0e31544 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1233,24 +1233,31 @@ static NTSTATUS dlopen_dll( const char *so_name, UNICODE_STRING *nt_name, void * /*********************************************************************** * ntdll_init_syscalls */ -NTSTATUS ntdll_init_syscalls( ULONG id, SYSTEM_SERVICE_TABLE *table, void **dispatcher ) +NTSTATUS ntdll_init_syscalls( SYSTEM_SERVICE_TABLE *table, void **dispatcher ) { struct syscall_info { void *dispatcher; + UINT version; + USHORT id; USHORT limit; - BYTE args[1]; + /* USHORT names[limit]; */ + /* BYTE args[limit]; */ } *info = (struct syscall_info *)dispatcher; - if (id > 3) return STATUS_INVALID_PARAMETER; + if (info->version != 0xca110001) + { + ERR( "invalid syscall table version %x\n", info->version ); + NtTerminateProcess( GetCurrentProcess(), STATUS_INVALID_PARAMETER ); + } if (info->limit != table->ServiceLimit) { ERR( "syscall count mismatch %u / %lu\n", info->limit, table->ServiceLimit ); NtTerminateProcess( GetCurrentProcess(), STATUS_INVALID_PARAMETER ); } info->dispatcher = __wine_syscall_dispatcher; - memcpy( table->ArgumentTable, info->args, table->ServiceLimit ); - KeServiceDescriptorTable[id] = *table; + memcpy( table->ArgumentTable, (USHORT *)(info + 1) + info->limit, table->ServiceLimit ); + KeServiceDescriptorTable[info->id] = *table; return STATUS_SUCCESS; } @@ -2093,7 +2100,7 @@ static void start_main_thread(void) load_ntdll(); if (main_image_info.Machine != current_machine) load_wow64_ntdll( main_image_info.Machine ); load_apiset_dll(); - ntdll_init_syscalls( 0, &syscall_table, p__wine_syscall_dispatcher ); + ntdll_init_syscalls( &syscall_table, p__wine_syscall_dispatcher ); server_init_process_done(); } diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 99fd7859250..b5fee3a12c7 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -461,7 +461,7 @@ static NTSTATUS init( void *dispatcher ) } #endif - return ntdll_init_syscalls( 1, &syscall_table, dispatcher ); + return ntdll_init_syscalls( &syscall_table, dispatcher ); } unixlib_entry_t __wine_unix_call_funcs[] = diff --git a/include/wine/unixlib.h b/include/wine/unixlib.h index f853f1c6a31..8a9522ec532 100644 --- a/include/wine/unixlib.h +++ b/include/wine/unixlib.h @@ -36,7 +36,7 @@ extern DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD d extern int ntdll_wcstoumbs( const WCHAR *src, DWORD srclen, char *dst, DWORD dstlen, BOOL strict ); extern int ntdll_wcsicmp( const WCHAR *str1, const WCHAR *str2 ); extern int ntdll_wcsnicmp( const WCHAR *str1, const WCHAR *str2, int n ); -extern NTSTATUS ntdll_init_syscalls( ULONG id, SYSTEM_SERVICE_TABLE *table, void **dispatcher ); +extern NTSTATUS ntdll_init_syscalls( SYSTEM_SERVICE_TABLE *table, void **dispatcher ); /* exception handling */ diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index fcf93addb50..99258a94527 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1529,8 +1529,11 @@ void output_syscalls( DLLSPEC *spec ) output( "\t.data\n" ); output( "\t.align %d\n", get_alignment( get_ptr_size() ) ); output( "%s\n", asm_globl("__wine_syscall_dispatcher") ); - output( "\t%s 0\n", get_asm_ptr_keyword() ); - output( "\t.short %u\n", count ); + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* dispatcher */ + output( "\t.long 0xca110001\n" ); /* version */ + output( "\t.short %u\n", spec->syscall_table ); /* id */ + output( "\t.short %u\n", count ); /* limit */ + for (i = 0; i < count; i++) output( "\t.short %u\n", syscalls[i]->hint ); for (i = 0; i < count; i++) output( "\t.byte %u\n", get_args_size( syscalls[i] )); }
1
0
0
0
Zebediah Figura : wined3d: Move the wined3d_gl.h include to individual files.
by Alexandre Julliard
25 Aug '23
25 Aug '23
Module: wine Branch: master Commit: 5bc6ab56d0eefd388b3ae37c7941cd118bd672da URL:
https://gitlab.winehq.org/wine/wine/-/commit/5bc6ab56d0eefd388b3ae37c7941cd…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Jan 6 16:46:51 2023 -0600 wined3d: Move the wined3d_gl.h include to individual files. --- dlls/wined3d/adapter_gl.c | 1 + dlls/wined3d/arb_program_shader.c | 1 + dlls/wined3d/ati_fragment_shader.c | 1 + dlls/wined3d/buffer.c | 1 + dlls/wined3d/context_gl.c | 1 + dlls/wined3d/cs.c | 3 ++- dlls/wined3d/device.c | 1 + dlls/wined3d/directx.c | 1 + dlls/wined3d/gl_compat.c | 1 + dlls/wined3d/glsl_shader.c | 1 + dlls/wined3d/nvidia_texture_shader.c | 1 + dlls/wined3d/query.c | 1 + dlls/wined3d/resource.c | 1 + dlls/wined3d/sampler.c | 1 + dlls/wined3d/shader.c | 1 + dlls/wined3d/state.c | 1 + dlls/wined3d/surface.c | 1 + dlls/wined3d/swapchain.c | 1 + dlls/wined3d/texture.c | 1 + dlls/wined3d/utils.c | 1 + dlls/wined3d/view.c | 1 + dlls/wined3d/wined3d_main.c | 1 + dlls/wined3d/wined3d_private.h | 2 -- 23 files changed, 23 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 9af08f6061f..776dcfb406c 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -24,6 +24,7 @@ #include <stdio.h> #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 14703e9c66c..c535fe7d3ff 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -30,6 +30,7 @@ #include <stdio.h> #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); WINE_DECLARE_DEBUG_CHANNEL(d3d_constants); diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index ec5c2ac6b6f..47426f0f49d 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -21,6 +21,7 @@ #include <stdio.h> #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); WINE_DECLARE_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index c71c1ac2a87..082d502ff98 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -23,6 +23,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" #include "wined3d_vk.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 36786cc5a29..5a45ae7dc72 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -25,6 +25,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 9a4f2cdfc94..3cfce72ae94 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -17,6 +17,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); @@ -186,7 +187,7 @@ struct wined3d_cs_draw { enum wined3d_cs_op opcode; enum wined3d_primitive_type primitive_type; - GLint patch_vertex_count; + unsigned int patch_vertex_count; struct wined3d_draw_parameters parameters; }; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 2b18e76de30..4b9ea98a04d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -25,6 +25,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" #include "wined3d_vk.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index ec975f5b9f3..78e743900ec 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -22,6 +22,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" #include "winternl.h" #include "wine/list.h" diff --git a/dlls/wined3d/gl_compat.c b/dlls/wined3d/gl_compat.c index 261b06fe778..451a5034a38 100644 --- a/dlls/wined3d/gl_compat.c +++ b/dlls/wined3d/gl_compat.c @@ -21,6 +21,7 @@ #include <stdio.h> #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(gl_compat); WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 6bbb432dc1d..552d1bd75bd 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -33,6 +33,7 @@ #include <stdio.h> #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); WINE_DECLARE_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index 3d86e16c864..eb548f6e366 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -23,6 +23,7 @@ #include <stdio.h> #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index 6894dc050a9..29384161b01 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -19,6 +19,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" #include "wined3d_vk.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 03a755391ee..9d3fd0a426d 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -22,6 +22,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" #include "wined3d_vk.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c index b4b169a59d4..e93ab18f436 100644 --- a/dlls/wined3d/sampler.c +++ b/dlls/wined3d/sampler.c @@ -18,6 +18,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" #include "wined3d_vk.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 96b47db9ed6..b6bfcd1184f 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -26,6 +26,7 @@ #include <string.h> #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index eb631fa1cb8..07c11269496 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -28,6 +28,7 @@ #include <stdio.h> #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index fd8db9ce60d..11b1da829d7 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -27,6 +27,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 30930bc17b6..84dcdb5b110 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -21,6 +21,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" #include "wined3d_vk.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 6b5d9eaf510..7ec5c4f4f3b 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -21,6 +21,7 @@ */ #include "wined3d_private.h" +#include "wined3d_gl.h" #include "wined3d_vk.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 2734a193e1f..e3c2a174cd2 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -27,6 +27,7 @@ #include <stdio.h> #include "wined3d_private.h" +#include "wined3d_gl.h" #include "wined3d_vk.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 675cc186b36..aa07625eb8a 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -19,6 +19,7 @@ #include "wined3d_private.h" #include "wined3d_shaders.h" +#include "wined3d_gl.h" #include "wined3d_vk.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 0ff215f7312..11646d3705d 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -26,6 +26,7 @@ #define VKD3D_NO_WIN32_TYPES #include "initguid.h" #include "wined3d_private.h" +#include "wined3d_gl.h" #include "d3d12.h" #define VK_NO_PROTOTYPES #include "wine/vulkan.h" diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 9846a25392f..1d9fc796343 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -5081,6 +5081,4 @@ static inline bool wined3d_map_persistent(void) extern CRITICAL_SECTION wined3d_command_cs; -#include "wined3d_gl.h" - #endif
1
0
0
0
Zebediah Figura : wined3d: Move the remaining GL-specific definitions to wined3d_gl.h.
by Alexandre Julliard
25 Aug '23
25 Aug '23
Module: wine Branch: master Commit: 3c7f325fc97878dff1297d4f3bd0f76422408ccf URL:
https://gitlab.winehq.org/wine/wine/-/commit/3c7f325fc97878dff1297d4f3bd0f7…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Jan 6 16:39:41 2023 -0600 wined3d: Move the remaining GL-specific definitions to wined3d_gl.h. --- dlls/wined3d/wined3d_gl.h | 22 ++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 25 ++----------------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 0e744fe5023..98832d54ff5 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -925,6 +925,20 @@ GLbitfield wined3d_resource_gl_map_flags(const struct wined3d_bo_gl *bo, DWORD d GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags); GLbitfield wined3d_resource_gl_storage_flags(const struct wined3d_resource *resource); +static inline void wined3d_context_gl_reference_bo(struct wined3d_context_gl *context_gl, struct wined3d_bo_gl *bo_gl) +{ + struct wined3d_device_gl *device_gl = wined3d_device_gl(context_gl->c.device); + + bo_gl->command_fence_id = device_gl->current_fence_id; +} + +static inline void wined3d_context_gl_reference_buffer(struct wined3d_context_gl *context_gl, + struct wined3d_buffer *buffer) +{ + if (buffer->buffer_object) + wined3d_context_gl_reference_bo(context_gl, wined3d_bo_gl(buffer->buffer_object)); +} + struct gl_texture { struct wined3d_sampler_desc sampler_desc; @@ -982,6 +996,14 @@ static inline GLenum wined3d_texture_gl_get_sub_resource_target(const struct win return texture_gl->target; } +static inline GLuint wined3d_texture_gl_get_texture_name(const struct wined3d_texture_gl *texture_gl, + const struct wined3d_context *context, bool srgb) +{ + if (srgb && needs_separate_srgb_gl_texture(context, &texture_gl->t)) + return texture_gl->texture_srgb.name; + return texture_gl->texture_rgb.name; +} + static inline bool wined3d_texture_gl_is_multisample_location(const struct wined3d_texture_gl *texture_gl, uint32_t location) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index e353c7d18de..9846a25392f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4623,8 +4623,6 @@ uint32_t wined3d_format_pack(const struct wined3d_format *format, const struct w BOOL wined3d_formats_are_srgb_variants(enum wined3d_format_id format1, enum wined3d_format_id format2) DECLSPEC_HIDDEN; -#include "wined3d_gl.h" - BOOL wined3d_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size) DECLSPEC_HIDDEN; static inline BOOL wined3d_format_is_typeless(const struct wined3d_format *format) @@ -4701,13 +4699,6 @@ static inline BOOL needs_srgb_write(const struct wined3d_d3d_info *d3d_info, && fb->render_targets[0] && fb->render_targets[0]->format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE; } -static inline GLuint wined3d_texture_gl_get_texture_name(const struct wined3d_texture_gl *texture_gl, - const struct wined3d_context *context, BOOL srgb) -{ - return srgb && needs_separate_srgb_gl_texture(context, &texture_gl->t) - ? texture_gl->texture_srgb.name : texture_gl->texture_rgb.name; -} - static inline BOOL can_use_texture_swizzle(const struct wined3d_d3d_info *d3d_info, const struct wined3d_format *format) { return d3d_info->texture_swizzle && !is_complex_fixup(format->color_fixup) && !is_scaling_fixup(format->color_fixup); @@ -5080,20 +5071,6 @@ static inline bool wined3d_primitive_type_is_list(enum wined3d_primitive_type t) || t == WINED3D_PT_PATCH; } -static inline void wined3d_context_gl_reference_bo(struct wined3d_context_gl *context_gl, struct wined3d_bo_gl *bo_gl) -{ - struct wined3d_device_gl *device_gl = wined3d_device_gl(context_gl->c.device); - - bo_gl->command_fence_id = device_gl->current_fence_id; -} - -static inline void wined3d_context_gl_reference_buffer(struct wined3d_context_gl *context_gl, - struct wined3d_buffer *buffer) -{ - if (buffer->buffer_object) - wined3d_context_gl_reference_bo(context_gl, wined3d_bo_gl(buffer->buffer_object)); -} - static inline bool wined3d_map_persistent(void) { return sizeof(void *) >= sizeof(uint64_t); @@ -5104,4 +5081,6 @@ static inline bool wined3d_map_persistent(void) extern CRITICAL_SECTION wined3d_command_cs; +#include "wined3d_gl.h" + #endif
1
0
0
0
Zebediah Figura : wined3d: Move struct wined3d_format_gl to wined3d_gl.h.
by Alexandre Julliard
25 Aug '23
25 Aug '23
Module: wine Branch: master Commit: 9a73d1d647245a2f50e75ed718d5f6c4dc6ff641 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9a73d1d647245a2f50e75ed718d5f6…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Jan 6 16:37:04 2023 -0600 wined3d: Move struct wined3d_format_gl to wined3d_gl.h. --- dlls/wined3d/wined3d_gl.h | 32 ++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 32 -------------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 9d1827cd608..0e744fe5023 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -1134,4 +1134,36 @@ HRESULT wined3d_swapchain_gl_init(struct wined3d_swapchain_gl *swapchain_gl, str const struct wined3d_swapchain_desc *desc, struct wined3d_swapchain_state_parent *state_parent, void *parent, const struct wined3d_parent_ops *parent_ops); +struct wined3d_format_gl +{ + struct wined3d_format f; + + GLenum vtx_type; + GLint vtx_format; + + GLint internal; + GLint srgb_internal; + GLint rt_internal; + GLint format; + GLint type; + + GLenum view_class; +}; + +static inline const struct wined3d_format_gl *wined3d_format_gl(const struct wined3d_format *format) +{ + return CONTAINING_RECORD(format, struct wined3d_format_gl, f); +} + +static inline GLuint wined3d_gl_get_internal_format(struct wined3d_resource *resource, + const struct wined3d_format_gl *format_gl, bool srgb) +{ + if (srgb) + return format_gl->srgb_internal; + else if ((resource->bind_flags & WINED3D_BIND_RENDER_TARGET) && wined3d_resource_is_offscreen(resource)) + return format_gl->rt_internal; + else + return format_gl->internal; +} + #endif /* __WINE_WINED3D_GL */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 3198c36c37d..e353c7d18de 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4625,27 +4625,6 @@ BOOL wined3d_formats_are_srgb_variants(enum wined3d_format_id format1, #include "wined3d_gl.h" -struct wined3d_format_gl -{ - struct wined3d_format f; - - GLenum vtx_type; - GLint vtx_format; - - GLint internal; - GLint srgb_internal; - GLint rt_internal; - GLint format; - GLint type; - - GLenum view_class; -}; - -static inline const struct wined3d_format_gl *wined3d_format_gl(const struct wined3d_format *format) -{ - return CONTAINING_RECORD(format, struct wined3d_format_gl, f); -} - BOOL wined3d_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size) DECLSPEC_HIDDEN; static inline BOOL wined3d_format_is_typeless(const struct wined3d_format *format) @@ -4729,17 +4708,6 @@ static inline GLuint wined3d_texture_gl_get_texture_name(const struct wined3d_te ? texture_gl->texture_srgb.name : texture_gl->texture_rgb.name; } -static inline GLuint wined3d_gl_get_internal_format(struct wined3d_resource *resource, - const struct wined3d_format_gl *format_gl, bool srgb) -{ - if (srgb) - return format_gl->srgb_internal; - else if (resource->bind_flags & WINED3D_BIND_RENDER_TARGET && wined3d_resource_is_offscreen(resource)) - return format_gl->rt_internal; - else - return format_gl->internal; -} - static inline BOOL can_use_texture_swizzle(const struct wined3d_d3d_info *d3d_info, const struct wined3d_format *format) { return d3d_info->texture_swizzle && !is_complex_fixup(format->color_fixup) && !is_scaling_fixup(format->color_fixup);
1
0
0
0
Zebediah Figura : wined3d: Move the remaining wined3d_gl_info functions to wined3d_gl.h.
by Alexandre Julliard
25 Aug '23
25 Aug '23
Module: wine Branch: master Commit: 3581fb19f69de77a422a7b6d45b354c03285e7bc URL:
https://gitlab.winehq.org/wine/wine/-/commit/3581fb19f69de77a422a7b6d45b354…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Jan 6 16:33:02 2023 -0600 wined3d: Move the remaining wined3d_gl_info functions to wined3d_gl.h. --- dlls/wined3d/wined3d_gl.h | 4 ++++ dlls/wined3d/wined3d_private.h | 10 ++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 59512b7bcc6..9d1827cd608 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -364,7 +364,11 @@ struct wined3d_gl_info void install_gl_compat_wrapper(struct wined3d_gl_info *gl_info, enum wined3d_gl_extension ext); void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLuint id, BOOL program); +void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, + BOOL is_alpha, int stage, enum wined3d_texture_op op, uint32_t arg1, uint32_t arg2, uint32_t arg3, + int texture_idx, DWORD dst); void shader_glsl_validate_link(const struct wined3d_gl_info *gl_info, GLuint program); +void texture_activate_dimensions(struct wined3d_texture *texture, const struct wined3d_gl_info *gl_info); GLenum wined3d_buffer_gl_binding_from_bind_flags(const struct wined3d_gl_info *gl_info, uint32_t bind_flags); void wined3d_check_gl_call(const struct wined3d_gl_info *gl_info, const char *file, unsigned int line, const char *name); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c8132783223..3198c36c37d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -95,7 +95,6 @@ static inline const char *wined3d_get_line(const char **ptr, const char *end) struct wined3d_fragment_pipe_ops; struct wined3d_adapter; struct wined3d_context; -struct wined3d_gl_info; struct wined3d_state; struct wined3d_vertex_pipe_ops; @@ -4092,8 +4091,6 @@ HRESULT wined3d_swapchain_no3d_init(struct wined3d_swapchain *swapchain_no3d, struct wined3d_swapchain_state_parent *state_parent, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; -#include "wined3d_gl.h" - /***************************************************************************** * Utility function prototypes */ @@ -4128,11 +4125,6 @@ void dump_color_fixup_desc(struct color_fixup_desc fixup) DECLSPEC_HIDDEN; BOOL is_invalid_op(const struct wined3d_state *state, int stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3) DECLSPEC_HIDDEN; -void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, - BOOL is_alpha, int stage, enum wined3d_texture_op op, uint32_t arg1, uint32_t arg2, uint32_t arg3, - INT texture_idx, DWORD dst) DECLSPEC_HIDDEN; -void texture_activate_dimensions(struct wined3d_texture *texture, - const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; void sampler_texdim(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN; void tex_alphaop(struct wined3d_context *context, @@ -4631,6 +4623,8 @@ uint32_t wined3d_format_pack(const struct wined3d_format *format, const struct w BOOL wined3d_formats_are_srgb_variants(enum wined3d_format_id format1, enum wined3d_format_id format2) DECLSPEC_HIDDEN; +#include "wined3d_gl.h" + struct wined3d_format_gl { struct wined3d_format f;
1
0
0
0
Zebediah Figura : wined3d: Move struct wined3d_swapchain_gl to wined3d_gl.h.
by Alexandre Julliard
25 Aug '23
25 Aug '23
Module: wine Branch: master Commit: 6c1eb2cf4007705264d72524b4c383e018401d98 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6c1eb2cf4007705264d72524b4c383…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Jan 6 16:29:57 2023 -0600 wined3d: Move struct wined3d_swapchain_gl to wined3d_gl.h. --- dlls/wined3d/wined3d_gl.h | 17 +++++++++++++++++ dlls/wined3d/wined3d_private.h | 20 +------------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index cb9810a3f1c..59512b7bcc6 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -32,6 +32,7 @@ #include "wine/wgl.h" #include "wine/wgl_driver.h" +struct wined3d_swapchain_gl; struct wined3d_texture_gl; #define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 /* not in the gl spec */ @@ -1113,4 +1114,20 @@ HRESULT wined3d_unordered_access_view_gl_init(struct wined3d_unordered_access_vi void wined3d_unordered_access_view_gl_update(struct wined3d_unordered_access_view_gl *uav_gl, struct wined3d_context_gl *context_gl); +struct wined3d_swapchain_gl +{ + struct wined3d_swapchain s; +}; + +static inline struct wined3d_swapchain_gl *wined3d_swapchain_gl(struct wined3d_swapchain *swapchain) +{ + return CONTAINING_RECORD(swapchain, struct wined3d_swapchain_gl, s); +} + +void wined3d_swapchain_gl_cleanup(struct wined3d_swapchain_gl *swapchain_gl); +struct wined3d_context_gl *wined3d_swapchain_gl_get_context(struct wined3d_swapchain_gl *swapchain_gl); +HRESULT wined3d_swapchain_gl_init(struct wined3d_swapchain_gl *swapchain_gl, struct wined3d_device *device, + const struct wined3d_swapchain_desc *desc, struct wined3d_swapchain_state_parent *state_parent, + void *parent, const struct wined3d_parent_ops *parent_ops); + #endif /* __WINE_WINED3D_GL */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f79cc01974d..c8132783223 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -97,7 +97,6 @@ struct wined3d_adapter; struct wined3d_context; struct wined3d_gl_info; struct wined3d_state; -struct wined3d_swapchain_gl; struct wined3d_vertex_pipe_ops; enum wined3d_ffp_idx @@ -4028,8 +4027,6 @@ void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_ void wined3d_unordered_access_view_set_counter(struct wined3d_unordered_access_view *view, unsigned int value) DECLSPEC_HIDDEN; -#include "wined3d_gl.h" - struct wined3d_swapchain_state { struct wined3d *wined3d; @@ -4095,22 +4092,7 @@ HRESULT wined3d_swapchain_no3d_init(struct wined3d_swapchain *swapchain_no3d, struct wined3d_swapchain_state_parent *state_parent, void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; -struct wined3d_swapchain_gl -{ - struct wined3d_swapchain s; -}; - -static inline struct wined3d_swapchain_gl *wined3d_swapchain_gl(struct wined3d_swapchain *swapchain) -{ - return CONTAINING_RECORD(swapchain, struct wined3d_swapchain_gl, s); -} - -void wined3d_swapchain_gl_cleanup(struct wined3d_swapchain_gl *swapchain_gl) DECLSPEC_HIDDEN; -struct wined3d_context_gl *wined3d_swapchain_gl_get_context(struct wined3d_swapchain_gl *swapchain_gl) DECLSPEC_HIDDEN; -HRESULT wined3d_swapchain_gl_init(struct wined3d_swapchain_gl *swapchain_gl, - struct wined3d_device *device, const struct wined3d_swapchain_desc *desc, - struct wined3d_swapchain_state_parent *state_parent, void *parent, - const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; +#include "wined3d_gl.h" /***************************************************************************** * Utility function prototypes
1
0
0
0
Zebediah Figura : wined3d: Move struct wined3d_unordered_access_view_gl to wined3d_gl.h.
by Alexandre Julliard
25 Aug '23
25 Aug '23
Module: wine Branch: master Commit: a555afc76efc4de7e79c4c6cececd7b9ed7a9df0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a555afc76efc4de7e79c4c6cececd7…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Jan 6 16:29:39 2023 -0600 wined3d: Move struct wined3d_unordered_access_view_gl to wined3d_gl.h. --- dlls/wined3d/wined3d_gl.h | 22 ++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 24 +----------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 40abd36f3b7..cb9810a3f1c 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -1091,4 +1091,26 @@ HRESULT wined3d_shader_resource_view_gl_init(struct wined3d_shader_resource_view void wined3d_shader_resource_view_gl_update(struct wined3d_shader_resource_view_gl *srv_gl, struct wined3d_context_gl *context_gl); +struct wined3d_unordered_access_view_gl +{ + struct wined3d_unordered_access_view v; + struct wined3d_bo_user bo_user; + struct wined3d_gl_view gl_view; + struct wined3d_bo_gl counter_bo; +}; + +static inline struct wined3d_unordered_access_view_gl *wined3d_unordered_access_view_gl( + struct wined3d_unordered_access_view *view) +{ + return CONTAINING_RECORD(view, struct wined3d_unordered_access_view_gl, v); +} + +void wined3d_unordered_access_view_gl_clear(struct wined3d_unordered_access_view_gl *view_gl, + const struct wined3d_uvec4 *clear_value, struct wined3d_context_gl *context_gl, bool fp); +HRESULT wined3d_unordered_access_view_gl_init(struct wined3d_unordered_access_view_gl *view_gl, + const struct wined3d_view_desc *desc, struct wined3d_resource *resource, + void *parent, const struct wined3d_parent_ops *parent_ops); +void wined3d_unordered_access_view_gl_update(struct wined3d_unordered_access_view_gl *uav_gl, + struct wined3d_context_gl *context_gl); + #endif /* __WINE_WINED3D_GL */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7a4766b5736..f79cc01974d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4006,8 +4006,6 @@ struct wined3d_shader_resource_view void wined3d_shader_resource_view_cleanup(struct wined3d_shader_resource_view *view) DECLSPEC_HIDDEN; -#include "wined3d_gl.h" - struct wined3d_unordered_access_view { LONG refcount; @@ -4030,27 +4028,7 @@ void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_ void wined3d_unordered_access_view_set_counter(struct wined3d_unordered_access_view *view, unsigned int value) DECLSPEC_HIDDEN; -struct wined3d_unordered_access_view_gl -{ - struct wined3d_unordered_access_view v; - struct wined3d_bo_user bo_user; - struct wined3d_gl_view gl_view; - struct wined3d_bo_gl counter_bo; -}; - -static inline struct wined3d_unordered_access_view_gl *wined3d_unordered_access_view_gl( - struct wined3d_unordered_access_view *view) -{ - return CONTAINING_RECORD(view, struct wined3d_unordered_access_view_gl, v); -} - -void wined3d_unordered_access_view_gl_clear(struct wined3d_unordered_access_view_gl *view_gl, - const struct wined3d_uvec4 *clear_value, struct wined3d_context_gl *context_gl, bool fp) DECLSPEC_HIDDEN; -HRESULT wined3d_unordered_access_view_gl_init(struct wined3d_unordered_access_view_gl *view_gl, - const struct wined3d_view_desc *desc, struct wined3d_resource *resource, - void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; -void wined3d_unordered_access_view_gl_update(struct wined3d_unordered_access_view_gl *uav_gl, - struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; +#include "wined3d_gl.h" struct wined3d_swapchain_state {
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
67
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
Results per page:
10
25
50
100
200