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
November 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
989 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Implement __os_arm64x_check_call().
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: 36036b9b60af330c50dc7cbda3d0c238937017f0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/36036b9b60af330c50dc7cbda3d0c2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 15 13:35:15 2023 +0100 ntdll: Implement __os_arm64x_check_call(). --- dlls/ntdll/signal_arm64ec.c | 103 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index be22278a252..f17cbdaf063 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -159,6 +159,102 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer, } +static int code_match( BYTE *code, const BYTE *seq, size_t len ) +{ + for ( ; len; len--, code++, seq++) if (*seq && *code != *seq) return 0; + return 1; +} + +void *check_call( void **target, void *exit_thunk, void *dest ) +{ + static const BYTE jmp_sequence[] = + { + 0xff, 0x25 /* jmp *xxx(%rip) */ + }; + static const BYTE fast_forward_sequence[] = + { + 0x48, 0x8b, 0xc4, /* mov %rsp,%rax */ + 0x48, 0x89, 0x58, 0x20, /* mov %rbx,0x20(%rax) */ + 0x55, /* push %rbp */ + 0x5d, /* pop %rbp */ + 0xe9 /* jmp arm_code */ + }; + static const BYTE syscall_sequence[] = + { + 0x4c, 0x8b, 0xd1, /* mov %rcx,%r10 */ + 0xb8, 0, 0, 0, 0, /* mov $xxx,%eax */ + 0xf6, 0x04, 0x25, 0x08, /* testb $0x1,0x7ffe0308 */ + 0x03, 0xfe, 0x7f, 0x01, + 0x75, 0x03, /* jne 1f */ + 0x0f, 0x05, /* syscall */ + 0xc3, /* ret */ + 0xcd, 0x2e, /* 1: int $0x2e */ + 0xc3 /* ret */ + }; + + for (;;) + { + if (dest == __wine_unix_call_dispatcher) return dest; + if (RtlIsEcCode( dest )) return dest; + if (code_match( dest, jmp_sequence, sizeof(jmp_sequence) )) + { + int *off_ptr = (int *)((char *)dest + sizeof(jmp_sequence)); + void **addr_ptr = (void **)((char *)(off_ptr + 1) + *off_ptr); + dest = *addr_ptr; + continue; + } + if (!((ULONG_PTR)dest & 15)) /* fast-forward and syscall thunks are always aligned */ + { + if (code_match( dest, fast_forward_sequence, sizeof(fast_forward_sequence) )) + { + int *off_ptr = (int *)((char *)dest + sizeof(fast_forward_sequence)); + return (char *)(off_ptr + 1) + *off_ptr; + } + if (code_match( dest, syscall_sequence, sizeof(syscall_sequence) )) + { + ULONG id = ((ULONG *)dest)[1]; + FIXME( "syscall %x at %p not implemented\n", id, dest ); + } + } + *target = dest; + return exit_thunk; + } +} + +static void __attribute__((naked)) arm64x_check_call(void) +{ + asm( "stp x29, x30, [sp,#-0xb0]!\n\t" + "mov x29, sp\n\t" + "stp x0, x1, [sp, #0x10]\n\t" + "stp x2, x3, [sp, #0x20]\n\t" + "stp x4, x5, [sp, #0x30]\n\t" + "stp x6, x7, [sp, #0x40]\n\t" + "stp x8, x9, [sp, #0x50]\n\t" + "stp x10, x15, [sp, #0x60]\n\t" + "stp d0, d1, [sp, #0x70]\n\t" + "stp d2, d3, [sp, #0x80]\n\t" + "stp d4, d5, [sp, #0x90]\n\t" + "stp d6, d7, [sp, #0xa0]\n\t" + "add x0, sp, #0x58\n\t" /* x9 = &target */ + "mov x1, x10\n\t" /* x10 = exit_thunk */ + "mov x2, x11\n\t" /* x11 = dest */ + "bl " __ASM_NAME("check_call") "\n\t" + "mov x11, x0\n\t" + "ldp x0, x1, [sp, #0x10]\n\t" + "ldp x2, x3, [sp, #0x20]\n\t" + "ldp x4, x5, [sp, #0x30]\n\t" + "ldp x6, x7, [sp, #0x40]\n\t" + "ldp x8, x9, [sp, #0x50]\n\t" + "ldp x10, x15, [sp, #0x60]\n\t" + "ldp d0, d1, [sp, #0x70]\n\t" + "ldp d2, d3, [sp, #0x80]\n\t" + "ldp d4, d5, [sp, #0x90]\n\t" + "ldp d6, d7, [sp, #0xa0]\n\t" + "ldp x29, x30, [sp], #0xb0\n\t" + "ret" ); +} + + /************************************************************************** * __chkstk (NTDLL.@) * @@ -212,6 +308,13 @@ void WINAPI RtlUserThreadStart( PRTL_THREAD_START_ROUTINE entry, void *arg ) */ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3, ULONG_PTR unk4 ) { + if (!__os_arm64x_check_call) + { + __os_arm64x_check_call = arm64x_check_call; + __os_arm64x_check_icall = arm64x_check_call; + __os_arm64x_check_icall_cfg = arm64x_check_call; + } + loader_init( context, (void **)&context->Rcx ); TRACE_(relay)( "\1Starting thread proc %p (arg=%p)\n", (void *)context->Rcx, (void *)context->Rdx ); NtContinue( context, TRUE );
1
0
0
0
Alexandre Julliard : ntdll: Set function pointers in the ARM64EC metadata on dll load.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: e4c9ec075b788148951c18f34225091969c5a957 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e4c9ec075b788148951c18f3422509…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 15 13:09:07 2023 +0100 ntdll: Set function pointers in the ARM64EC metadata on dll load. --- dlls/ntdll/loader.c | 96 +++++++++++++++++++++++++++++++++++++++---------- dlls/ntdll/ntdll_misc.h | 13 +++++++ 2 files changed, 91 insertions(+), 18 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 93edc237405..89756c57433 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -241,6 +241,52 @@ static void module_push_unload_trace( const WINE_MODREF *wm ) unload_trace_ptr = unload_traces; } +#ifdef __arm64ec__ + +static void update_hybrid_metadata( void *module, IMAGE_NT_HEADERS *nt, + const IMAGE_ARM64EC_METADATA *metadata ) +{ + DWORD i, protect_old; + const IMAGE_SECTION_HEADER *sec = IMAGE_FIRST_SECTION( nt ); + + if (metadata->Version != 1) + { + ERR( "unknown version %lu\n", metadata->Version ); + return; + } + + /* assume that all pointers are in the same section */ + + for (i = 0; i < nt->FileHeader.NumberOfSections; i++, sec++) + { + if ((sec->VirtualAddress <= metadata->__os_arm64x_dispatch_call) && + (sec->VirtualAddress + sec->Misc.VirtualSize > metadata->__os_arm64x_dispatch_call)) + { + void *base = get_rva( module, sec->VirtualAddress ); + SIZE_T size = sec->Misc.VirtualSize; + + NtProtectVirtualMemory( NtCurrentProcess(), &base, &size, PAGE_READWRITE, &protect_old ); + +#define SET_FUNC(func,val) *(void **)get_rva( module, metadata->func ) = val + SET_FUNC( __os_arm64x_dispatch_call, __os_arm64x_check_call ); + SET_FUNC( __os_arm64x_dispatch_call_no_redirect, __os_arm64x_dispatch_call_no_redirect ); + SET_FUNC( __os_arm64x_dispatch_fptr, __os_arm64x_dispatch_fptr ); + SET_FUNC( __os_arm64x_dispatch_icall, __os_arm64x_check_icall ); + SET_FUNC( __os_arm64x_dispatch_icall_cfg, __os_arm64x_check_icall_cfg ); + SET_FUNC( __os_arm64x_dispatch_ret, __os_arm64x_dispatch_ret ); + SET_FUNC( GetX64InformationFunctionPointer, __os_arm64x_get_x64_information ); + SET_FUNC( SetX64InformationFunctionPointer, __os_arm64x_set_x64_information ); +#undef SET_FUNC + + NtProtectVirtualMemory( NtCurrentProcess(), &base, &size, protect_old, &protect_old ); + return; + } + } + ERR( "module %p no section found for %lx\n", module, metadata->__os_arm64x_dispatch_call ); +} + +#endif + /********************************************************************* * RtlGetUnloadEventTrace [NTDLL.@] */ @@ -1983,26 +2029,10 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name, * Create a random security cookie for buffer overflow protection. Make * sure it does not accidentally match the default cookie value. */ -static void set_security_cookie( void *module, SIZE_T len ) +static void set_security_cookie( ULONG_PTR *cookie ) { static ULONG seed; - IMAGE_LOAD_CONFIG_DIRECTORY *loadcfg; - ULONG loadcfg_size; - ULONG_PTR *cookie; - - loadcfg = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, &loadcfg_size ); - if (!loadcfg) return; - if (loadcfg_size < offsetof(IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie) + sizeof(loadcfg->SecurityCookie)) return; - if (!loadcfg->SecurityCookie) return; - if (loadcfg->SecurityCookie < (ULONG_PTR)module || - loadcfg->SecurityCookie > (ULONG_PTR)module + len - sizeof(ULONG_PTR)) - { - WARN( "security cookie %p outside of image %p-%p\n", - (void *)loadcfg->SecurityCookie, module, (char *)module + len ); - return; - } - cookie = (ULONG_PTR *)loadcfg->SecurityCookie; TRACE( "initializing security cookie %p\n", cookie ); if (!seed) seed = NtGetTickCount() ^ GetCurrentProcessId(); @@ -2025,6 +2055,36 @@ static void set_security_cookie( void *module, SIZE_T len ) } } + +/*********************************************************************** + * update_load_config + */ +static void update_load_config( void *module ) +{ + IMAGE_NT_HEADERS *nt = RtlImageNtHeader( module ); + IMAGE_LOAD_CONFIG_DIRECTORY *cfg; + ULONG size; + + cfg = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG, &size ); + if (!cfg) return; + size = min( size, cfg->Size ); + if (size > offsetof( IMAGE_LOAD_CONFIG_DIRECTORY, SecurityCookie ) && + cfg->SecurityCookie > (ULONG_PTR)module && + cfg->SecurityCookie < (ULONG_PTR)module + nt->OptionalHeader.SizeOfImage) + { + set_security_cookie( (ULONG_PTR *)cfg->SecurityCookie ); + } +#ifdef __arm64ec__ + if (size > offsetof( IMAGE_LOAD_CONFIG_DIRECTORY, CHPEMetadataPointer ) && + cfg->CHPEMetadataPointer > (ULONG_PTR)module && + cfg->CHPEMetadataPointer < (ULONG_PTR)module + nt->OptionalHeader.SizeOfImage) + { + update_hybrid_metadata( module, nt, (void *)cfg->CHPEMetadataPointer ); + } +#endif +} + + static NTSTATUS perform_relocations( void *module, IMAGE_NT_HEADERS *nt, SIZE_T len ) { char *base; @@ -2135,7 +2195,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, if (image_info->ComPlusILOnly) wm->ldr.Flags |= LDR_COR_ILONLY; wm->system = system; - set_security_cookie( *module, map_size ); + update_load_config( *module ); /* fixup imports */ diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 8d489afda7f..d24bd0c887a 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -131,4 +131,17 @@ static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len ) extern TEB_FLS_DATA *fls_alloc_data(void) DECLSPEC_HIDDEN; extern void heap_thread_detach(void) DECLSPEC_HIDDEN; +#ifdef __arm64ec__ + +extern void *__os_arm64x_check_call; +extern void *__os_arm64x_check_icall; +extern void *__os_arm64x_check_icall_cfg; +extern void *__os_arm64x_dispatch_call_no_redirect; +extern void *__os_arm64x_dispatch_fptr; +extern void *__os_arm64x_dispatch_ret; +extern void *__os_arm64x_get_x64_information; +extern void *__os_arm64x_set_x64_information; + +#endif + #endif
1
0
0
0
Alexandre Julliard : makefiles: Use --defines instead of --header for compatibility with older bison.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: 6eff423a8ff8d0ca0066bf60138c5112e4ce5084 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6eff423a8ff8d0ca0066bf60138c51…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 15 10:42:20 2023 +0100 makefiles: Use --defines instead of --header for compatibility with older bison. Spotted by Rémi Bernon. --- tools/makedep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/makedep.c b/tools/makedep.c index a766c820fc1..8ce575b15ca 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -2685,7 +2685,7 @@ static void output_source_y( struct makefile *make, struct incl_file *source, co if (find_include_file( make, header )) { output( "%s: %s\n", obj_dir_path( make, header ), source->filename ); - output( "\t%s%s -o %s.tab.$$$$.c --header=$@ %s && rm -f %s.tab.$$$$.c\n", + output( "\t%s%s -o %s.tab.$$$$.c --defines=$@ %s && rm -f %s.tab.$$$$.c\n", cmd_prefix( "BISON" ), bison, obj_dir_path( make, obj ), source->filename, obj_dir_path( make, obj )); strarray_add( &make->clean_files, header );
1
0
0
0
Nikolay Sivov : vkd3d-shader/hlsl: Add a helper to check for a numeric type.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: vkd3d Branch: master Commit: 88caf877893f675cf3dc999a843b9e03b0e58b0f URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/88caf877893f675cf3dc999a843b9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Nov 13 02:05:50 2023 +0100 vkd3d-shader/hlsl: Add a helper to check for a numeric type. --- libs/vkd3d-shader/hlsl.c | 2 +- libs/vkd3d-shader/hlsl.h | 5 +++++ libs/vkd3d-shader/hlsl.y | 26 +++++++++++++------------- libs/vkd3d-shader/hlsl_codegen.c | 10 +++++----- libs/vkd3d-shader/tpf.c | 2 +- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 593ca0a3..501bff8c 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -220,7 +220,7 @@ bool hlsl_type_is_resource(const struct hlsl_type *type) * resources, since for both their data types span across a single regset. */ static enum hlsl_regset type_get_regset(const struct hlsl_type *type) { - if (type->class <= HLSL_CLASS_LAST_NUMERIC) + if (hlsl_is_numeric_type(type)) return HLSL_REGSET_NUMERIC; if (type->class == HLSL_CLASS_ARRAY) diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 615529c1..f3596764 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -1105,6 +1105,11 @@ static inline struct hlsl_type *hlsl_get_numeric_type(const struct hlsl_ctx *ctx return hlsl_get_matrix_type(ctx, base_type, dimx, dimy); } +static inline bool hlsl_is_numeric_type(const struct hlsl_type *type) +{ + return type->class <= HLSL_CLASS_LAST_NUMERIC; +} + static inline unsigned int hlsl_sampler_dim_count(enum hlsl_sampler_dim dim) { switch (dim) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index e8f84fe6..5e0d48d3 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -211,7 +211,7 @@ static bool hlsl_types_are_componentwise_equal(struct hlsl_ctx *ctx, struct hlsl return true; } -static bool type_contains_only_numerics(struct hlsl_type *type) +static bool type_contains_only_numerics(const struct hlsl_type *type) { unsigned int i; @@ -226,12 +226,12 @@ static bool type_contains_only_numerics(struct hlsl_type *type) } return true; } - return type->class <= HLSL_CLASS_LAST_NUMERIC; + return hlsl_is_numeric_type(type); } static bool explicit_compatible_data_types(struct hlsl_ctx *ctx, struct hlsl_type *src, struct hlsl_type *dst) { - if (src->class <= HLSL_CLASS_LAST_NUMERIC && src->dimx == 1 && src->dimy == 1 && type_contains_only_numerics(dst)) + if (hlsl_is_numeric_type(src) && src->dimx == 1 && src->dimy == 1 && type_contains_only_numerics(dst)) return true; if (src->class == HLSL_CLASS_MATRIX && dst->class == HLSL_CLASS_MATRIX @@ -251,10 +251,10 @@ static bool explicit_compatible_data_types(struct hlsl_ctx *ctx, struct hlsl_typ static bool implicit_compatible_data_types(struct hlsl_ctx *ctx, struct hlsl_type *src, struct hlsl_type *dst) { - if ((src->class <= HLSL_CLASS_LAST_NUMERIC) != (dst->class <= HLSL_CLASS_LAST_NUMERIC)) + if (hlsl_is_numeric_type(src) != hlsl_is_numeric_type(dst)) return false; - if (src->class <= HLSL_CLASS_LAST_NUMERIC) + if (hlsl_is_numeric_type(src)) { /* Scalar vars can be converted to any other numeric data type */ if (src->dimx == 1 && src->dimy == 1) @@ -311,7 +311,7 @@ static struct hlsl_ir_node *add_cast(struct hlsl_ctx *ctx, struct hlsl_block *bl struct hlsl_ir_var *var; unsigned int dst_idx; - broadcast = src_type->class <= HLSL_CLASS_LAST_NUMERIC && src_type->dimx == 1 && src_type->dimy == 1; + broadcast = hlsl_is_numeric_type(src_type) && src_type->dimx == 1 && src_type->dimy == 1; matrix_cast = !broadcast && dst_comp_count != src_comp_count && src_type->class == HLSL_CLASS_MATRIX && dst_type->class == HLSL_CLASS_MATRIX; assert(src_comp_count >= dst_comp_count || broadcast); @@ -1292,7 +1292,7 @@ static enum hlsl_base_type expr_common_base_type(enum hlsl_base_type t1, enum hl static bool expr_common_shape(struct hlsl_ctx *ctx, struct hlsl_type *t1, struct hlsl_type *t2, const struct vkd3d_shader_location *loc, enum hlsl_type_class *type, unsigned int *dimx, unsigned int *dimy) { - if (t1->class > HLSL_CLASS_LAST_NUMERIC) + if (!hlsl_is_numeric_type(t1)) { struct vkd3d_string_buffer *string; @@ -1303,7 +1303,7 @@ static bool expr_common_shape(struct hlsl_ctx *ctx, struct hlsl_type *t1, struct return false; } - if (t2->class > HLSL_CLASS_LAST_NUMERIC) + if (!hlsl_is_numeric_type(t2)) { struct vkd3d_string_buffer *string; @@ -1775,7 +1775,7 @@ static struct hlsl_ir_node *add_assignment(struct hlsl_ctx *ctx, struct hlsl_blo return NULL; } - if (lhs_type->class <= HLSL_CLASS_LAST_NUMERIC) + if (hlsl_is_numeric_type(lhs_type)) writemask = (1 << lhs_type->dimx) - 1; if (!(rhs = add_implicit_conversion(ctx, block, rhs, lhs_type, &rhs->loc))) @@ -2005,7 +2005,7 @@ static bool type_has_object_components(struct hlsl_type *type, bool must_be_in_s static bool type_has_numeric_components(struct hlsl_type *type) { - if (type->class <= HLSL_CLASS_LAST_NUMERIC) + if (hlsl_is_numeric_type(type)) return true; if (type->class == HLSL_CLASS_ARRAY) return type_has_numeric_components(type->e.array.type); @@ -3926,7 +3926,7 @@ static struct hlsl_block *add_call(struct hlsl_ctx *ctx, const char *name, for (i = 0; i < args->args_count; ++i) { - if (args->args[i]->data_type->class > HLSL_CLASS_LAST_NUMERIC) + if (!hlsl_is_numeric_type(args->args[i]->data_type)) { struct vkd3d_string_buffer *string; @@ -6776,7 +6776,7 @@ postfix_expr: YYABORT; $$ = $1; } - else if (node->data_type->class <= HLSL_CLASS_LAST_NUMERIC) + else if (hlsl_is_numeric_type(node->data_type)) { struct hlsl_ir_node *swizzle; @@ -6819,7 +6819,7 @@ postfix_expr: free_parse_initializer(&$4); YYABORT; } - if ($2->class > HLSL_CLASS_LAST_NUMERIC) + if (!hlsl_is_numeric_type($2)) { struct vkd3d_string_buffer *string; diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 598d6c66..5a70878b 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -229,7 +229,7 @@ static void prepend_uniform_copy(struct hlsl_ctx *ctx, struct hlsl_block *block, static void validate_field_semantic(struct hlsl_ctx *ctx, struct hlsl_struct_field *field) { - if (!field->semantic.name && hlsl_get_multiarray_element_type(field->type)->class <= HLSL_CLASS_LAST_NUMERIC + if (!field->semantic.name && hlsl_is_numeric_type(hlsl_get_multiarray_element_type(field->type)) && !field->semantic.reported_missing) { hlsl_error(ctx, &field->loc, VKD3D_SHADER_ERROR_HLSL_MISSING_SEMANTIC, @@ -339,7 +339,7 @@ static void prepend_input_copy(struct hlsl_ctx *ctx, struct hlsl_block *block, s struct hlsl_ir_node *c; unsigned int i; - if (type->class > HLSL_CLASS_LAST_NUMERIC) + if (!hlsl_is_numeric_type(type)) { struct vkd3d_string_buffer *string; if (!(string = hlsl_type_to_string(ctx, type))) @@ -481,7 +481,7 @@ static void append_output_copy(struct hlsl_ctx *ctx, struct hlsl_block *block, s struct hlsl_ir_node *c; unsigned int i; - if (type->class > HLSL_CLASS_LAST_NUMERIC) + if (!hlsl_is_numeric_type(type)) { struct vkd3d_string_buffer *string; if (!(string = hlsl_type_to_string(ctx, type))) @@ -3942,7 +3942,7 @@ static void allocate_const_registers_recurse(struct hlsl_ctx *ctx, constant->reg = allocate_numeric_registers_for_type(ctx, allocator, 1, UINT_MAX, type); TRACE("Allocated constant @%u to %s.\n", instr->index, debug_register('c', constant->reg, type)); - assert(type->class <= HLSL_CLASS_LAST_NUMERIC); + assert(hlsl_is_numeric_type(type)); assert(type->dimy == 1); assert(constant->reg.writemask); @@ -4634,7 +4634,7 @@ struct hlsl_reg hlsl_reg_from_deref(struct hlsl_ctx *ctx, const struct hlsl_dere unsigned int offset = hlsl_offset_from_deref_safe(ctx, deref); assert(deref->data_type); - assert(deref->data_type->class <= HLSL_CLASS_LAST_NUMERIC); + assert(hlsl_is_numeric_type(deref->data_type)); ret.id += offset / 4; diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index 60fa3b98..594438a2 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -5411,7 +5411,7 @@ static void write_sm4_load(const struct tpf_writer *tpf, const struct hlsl_ir_lo sm4_dst_from_node(&instr.dsts[0], &load->node); instr.dst_count = 1; - assert(type->class <= HLSL_CLASS_LAST_NUMERIC); + assert(hlsl_is_numeric_type(type)); if (type->base_type == HLSL_TYPE_BOOL && var_is_user_input(tpf->ctx, load->src.var)) { struct hlsl_constant_value value;
1
0
0
0
Conor McCarthy : vkd3d: Support depth bounds test.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: vkd3d Branch: master Commit: 76eb0adf03a9fa8858d0b86b54966e2d0029035f URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/76eb0adf03a9fa8858d0b86b54966…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Jul 18 15:50:18 2023 +1000 vkd3d: Support depth bounds test. --- libs/vkd3d/device.c | 4 +--- libs/vkd3d/state.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index a158697b..79028fc3 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1522,9 +1522,7 @@ static HRESULT vkd3d_init_device_caps(struct d3d12_device *device, device->feature_options1.ExpandedComputeResourceStates = TRUE; device->feature_options1.Int64ShaderOps = features->shaderInt64; - /* Depth bounds test is enabled in D3D12_DEPTH_STENCIL_DESC1, which is not - * supported. */ - device->feature_options2.DepthBoundsTestSupported = FALSE; + device->feature_options2.DepthBoundsTestSupported = features->depthBounds; /* d3d12_command_list_SetSamplePositions() is not implemented. */ device->feature_options2.ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED; diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 47dbb208..de0e04ea 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -2659,7 +2659,7 @@ static void ds_desc_from_d3d12(struct VkPipelineDepthStencilStateCreateInfo *vk_ vk_desc->depthWriteEnable = VK_FALSE; vk_desc->depthCompareOp = VK_COMPARE_OP_NEVER; } - vk_desc->depthBoundsTestEnable = VK_FALSE; + vk_desc->depthBoundsTestEnable = d3d12_desc->DepthBoundsTestEnable; if ((vk_desc->stencilTestEnable = d3d12_desc->StencilEnable)) { vk_stencil_op_state_from_d3d12(&vk_desc->front, &d3d12_desc->FrontFace, @@ -3068,6 +3068,12 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s graphics->rt_count = rt_count; ds_desc_from_d3d12(&graphics->ds_desc, &desc->depth_stencil_state); + if (graphics->ds_desc.depthBoundsTestEnable && !device->feature_options2.DepthBoundsTestSupported) + { + WARN("Depth bounds test not supported by device.\n"); + hr = E_INVALIDARG; + goto fail; + } if (desc->dsv_format == DXGI_FORMAT_UNKNOWN && graphics->ds_desc.depthTestEnable && !graphics->ds_desc.depthWriteEnable && graphics->ds_desc.depthCompareOp == VK_COMPARE_OP_ALWAYS && !graphics->ds_desc.stencilTestEnable) @@ -3077,7 +3083,8 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s } graphics->dsv_format = VK_FORMAT_UNDEFINED; - if (graphics->ds_desc.depthTestEnable || graphics->ds_desc.stencilTestEnable) + if (graphics->ds_desc.depthTestEnable || graphics->ds_desc.stencilTestEnable + || graphics->ds_desc.depthBoundsTestEnable) { if (desc->dsv_format == DXGI_FORMAT_UNKNOWN) {
1
0
0
0
Conor McCarthy : tests: Test CreatePipelineState().
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: vkd3d Branch: master Commit: 63b8972b0e5d6aef67333e5f1af1fcb9a22cb35b URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/63b8972b0e5d6aef67333e5f1af1f…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Jul 18 14:21:48 2023 +1000 tests: Test CreatePipelineState(). Based on vkd3d-proton patches by Hans-Kristian Arntzen and Philip Rebohle. --- tests/d3d12.c | 476 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 476 insertions(+)
1
0
0
0
Conor McCarthy : vkd3d: Implement ID3D12Device2::CreatePipelineState().
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: vkd3d Branch: master Commit: d8ba0d2a1102a0d6774940e6060ea1b14046334e URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/d8ba0d2a1102a0d6774940e6060ea…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Nov 14 13:07:03 2023 +1000 vkd3d: Implement ID3D12Device2::CreatePipelineState(). --- libs/vkd3d/device.c | 11 ++- libs/vkd3d/state.c | 192 +++++++++++++++++++++++++++++++++++++++++++++ libs/vkd3d/vkd3d_private.h | 3 + 3 files changed, 204 insertions(+), 2 deletions(-)
1
0
0
0
Conor McCarthy : vkd3d: Use struct d3d12_pipeline_state_desc for compute pipelines.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: vkd3d Branch: master Commit: 6196199a891d838433d115e2772273c4c67292a8 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/6196199a891d838433d115e277227…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Nov 14 13:03:38 2023 +1000 vkd3d: Use struct d3d12_pipeline_state_desc for compute pipelines. --- libs/vkd3d/state.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 9e3fac7e..a1cad3d4 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -1763,6 +1763,17 @@ static void pipeline_state_desc_from_d3d12_graphics_desc(struct d3d12_pipeline_s desc->flags = d3d12_desc->Flags; } +static void pipeline_state_desc_from_d3d12_compute_desc(struct d3d12_pipeline_state_desc *desc, + const D3D12_COMPUTE_PIPELINE_STATE_DESC *d3d12_desc) +{ + memset(desc, 0, sizeof(*desc)); + desc->root_signature = d3d12_desc->pRootSignature; + desc->cs = d3d12_desc->CS; + desc->node_mask = d3d12_desc->NodeMask; + desc->cached_pso = d3d12_desc->CachedPSO; + desc->flags = d3d12_desc->Flags; +} + struct vkd3d_pipeline_key { D3D12_PRIMITIVE_TOPOLOGY topology; @@ -2220,7 +2231,7 @@ static HRESULT d3d12_pipeline_state_find_and_init_uav_counters(struct d3d12_pipe } static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *state, - struct d3d12_device *device, const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc) + struct d3d12_device *device, const struct d3d12_pipeline_state_desc *desc) { const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs; struct vkd3d_shader_interface_info shader_interface; @@ -2235,14 +2246,14 @@ static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *st memset(&state->uav_counters, 0, sizeof(state->uav_counters)); - if (!(root_signature = unsafe_impl_from_ID3D12RootSignature(desc->pRootSignature))) + if (!(root_signature = unsafe_impl_from_ID3D12RootSignature(desc->root_signature))) { WARN("Root signature is NULL.\n"); return E_INVALIDARG; } if (FAILED(hr = d3d12_pipeline_state_find_and_init_uav_counters(state, device, root_signature, - &desc->CS, VK_SHADER_STAGE_COMPUTE_BIT))) + &desc->cs, VK_SHADER_STAGE_COMPUTE_BIT))) return hr; memset(&target_info, 0, sizeof(target_info)); @@ -2283,7 +2294,7 @@ static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *st vk_pipeline_layout = state->uav_counters.vk_pipeline_layout ? state->uav_counters.vk_pipeline_layout : root_signature->vk_pipeline_layout; - if (FAILED(hr = vkd3d_create_compute_pipeline(device, &desc->CS, &shader_interface, + if (FAILED(hr = vkd3d_create_compute_pipeline(device, &desc->cs, &shader_interface, vk_pipeline_layout, &state->u.compute.vk_pipeline))) { WARN("Failed to create Vulkan compute pipeline, hr %#x.\n", hr); @@ -2307,13 +2318,16 @@ static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *st HRESULT d3d12_pipeline_state_create_compute(struct d3d12_device *device, const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, struct d3d12_pipeline_state **state) { + struct d3d12_pipeline_state_desc pipeline_desc; struct d3d12_pipeline_state *object; HRESULT hr; + pipeline_state_desc_from_d3d12_compute_desc(&pipeline_desc, desc); + if (!(object = vkd3d_malloc(sizeof(*object)))) return E_OUTOFMEMORY; - if (FAILED(hr = d3d12_pipeline_state_init_compute(object, device, desc))) + if (FAILED(hr = d3d12_pipeline_state_init_compute(object, device, &pipeline_desc))) { vkd3d_free(object); return hr;
1
0
0
0
Conor McCarthy : vkd3d: Introduce struct d3d12_pipeline_state_desc for graphics pipelines.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: vkd3d Branch: master Commit: 39afbb8e323030adbcc7287cc6ea67fe5f57ba48 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/39afbb8e323030adbcc7287cc6ea6…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Nov 14 12:49:17 2023 +1000 vkd3d: Introduce struct d3d12_pipeline_state_desc for graphics pipelines. A generic container for both compute and graphics pipeline descriptions to facilitate reading the description from a stream. --- libs/vkd3d/state.c | 130 ++++++++++++++++++++++++++++----------------- libs/vkd3d/vkd3d_private.h | 25 +++++++++ 2 files changed, 105 insertions(+), 50 deletions(-)
1
0
0
0
Conor McCarthy : include: Add a D3D12_RT_FORMAT_ARRAY typedef.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: vkd3d Branch: master Commit: 529c0f46b02b5aa396d8d1a6ef7e2a644cc4cb76 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/529c0f46b02b5aa396d8d1a6ef7e2…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Tue Nov 14 11:13:21 2023 +1000 include: Add a D3D12_RT_FORMAT_ARRAY typedef. For consistency with how other D3D12_* structs are declared. --- include/vkd3d_d3d12.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl index 9b1b494c..cdd3acec 100644 --- a/include/vkd3d_d3d12.idl +++ b/include/vkd3d_d3d12.idl @@ -2129,11 +2129,11 @@ typedef struct D3D12_PIPELINE_STATE_STREAM_DESC void *pPipelineStateSubobjectStream; } D3D12_PIPELINE_STATE_STREAM_DESC; -struct D3D12_RT_FORMAT_ARRAY +typedef struct D3D12_RT_FORMAT_ARRAY { DXGI_FORMAT RTFormats[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT]; UINT NumRenderTargets; -}; +} D3D12_RT_FORMAT_ARRAY; typedef enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE {
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
99
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Results per page:
10
25
50
100
200